You are here

public function AccessStorage::getAllowedUserIds in Permissions by Term 8.2

Same name and namespace in other branches
  1. 8 src/Service/AccessStorage.php \Drupal\permissions_by_term\Service\AccessStorage::getAllowedUserIds()

Parameters

int $term_id:

Return value

array

File

src/Service/AccessStorage.php, line 246

Class

AccessStorage
Class AccessStorage.

Namespace

Drupal\permissions_by_term\Service

Code

public function getAllowedUserIds($term_id, $langcode) {
  $query = $this->database
    ->select('permissions_by_term_user', 'p')
    ->fields('p', [
    'uid',
  ])
    ->condition('p.tid', $term_id)
    ->condition('p.langcode', $langcode);

  // fetchCol() returns all results, fetchAssoc() only "one" result.
  return $query
    ->execute()
    ->fetchCol();
}