public function TermHandler::getTidsBoundToAllNidsForPublishedNodes in Permissions by Term 8.2
File
- src/
Service/ TermHandler.php, line 81
Class
Namespace
Drupal\permissions_by_term\ServiceCode
public function getTidsBoundToAllNidsForPublishedNodes() : array {
$query = $this->database
->select('taxonomy_index', 'ti')
->fields('ti', [
'tid',
'nid',
]);
$nidToTids = [];
$ret = $query
->execute()
->fetchAll();
foreach ($ret as $returnObject) {
$nidToTids[$returnObject->nid][] = $returnObject->tid;
}
return $nidToTids;
}