You are here

public function KekUserSelection::entityQueryAlter in Heartbeat 8

Allows the selection to alter the SelectQuery generated by EntityFieldQuery.

Parameters

\Drupal\Core\Database\Query\SelectInterface $query: A Select Query object.

Overrides UserSelection::entityQueryAlter

File

src/Plugin/EntityReferenceReferenceSelection/KekUserSelection.php, line 29

Class

KekUserSelection
Provides specific access control for the user entity type.

Namespace

Drupal\heartbeat\Plugin\EntityReferenceSelection

Code

public function entityQueryAlter(SelectInterface $query) {
  parent::entityQueryAlter($query);
  $friendData = \Drupal::config('heartbeat_friendship.settings')
    ->get('data');
  $mynewvar = $query;
  $query
    ->condition('users.uid', $friendData, 'IN');
  return $query;
}