You are here

protected function GroupTypeRoleSelection::buildEntityQuery in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/EntityReferenceSelection/GroupTypeRoleSelection.php \Drupal\group\Plugin\EntityReferenceSelection\GroupTypeRoleSelection::buildEntityQuery()

Builds an EntityQuery to get referenceable entities.

Parameters

string|null $match: (Optional) Text to match the label against. Defaults to NULL.

string $match_operator: (Optional) The operation the matching should be done with. Defaults to "CONTAINS".

Return value

\Drupal\Core\Entity\Query\QueryInterface The EntityQuery object with the basic conditions and sorting applied to it.

Overrides DefaultSelection::buildEntityQuery

File

src/Plugin/EntityReferenceSelection/GroupTypeRoleSelection.php, line 26

Class

GroupTypeRoleSelection
Only shows the group roles which are available for a group type.

Namespace

Drupal\group\Plugin\EntityReferenceSelection

Code

protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
  $group_type_id = $this->configuration['group_type_id'];
  $query = parent::buildEntityQuery($match, $match_operator);
  $query
    ->condition('group_type', $group_type_id, '=');
  $query
    ->condition('internal', 0, '=');
  return $query;
}