You are here

public function TermHandler::getNidsByTidsForPublishedNodes in Permissions by Term 8.2

Parameters

array $tids:

Return value

array

File

src/Service/TermHandler.php, line 102

Class

TermHandler

Namespace

Drupal\permissions_by_term\Service

Code

public function getNidsByTidsForPublishedNodes($tids) {
  if (!empty($tids)) {
    $query = $this->database
      ->select('taxonomy_index', 'ti')
      ->fields('ti', [
      'nid',
    ])
      ->condition('ti.tid', $tids, 'IN');
    $nids = $query
      ->execute()
      ->fetchCol();
    return array_unique($nids);
  }
  else {
    return [];
  }
}