You are here

protected function WebformSelection::buildEntityQuery in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/EntityReferenceSelection/WebformSelection.php \Drupal\webform\Plugin\EntityReferenceSelection\WebformSelection::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/WebformSelection.php, line 36

Class

WebformSelection
Provides specific access control for the webform entity type.

Namespace

Drupal\webform\Plugin\EntityReferenceSelection

Code

protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
  $query = parent::buildEntityQuery($match, $match_operator);

  // Exclude templates.
  $query
    ->condition('template', FALSE);

  // Exclude archived.
  $query
    ->condition('archive', FALSE);
  return $query;
}