You are here

protected function SupportTicketSelection::buildEntityQuery in Support Ticketing System 8

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

modules/support_ticket/src/Plugin/EntityReferenceSelection/SupportTicketSelection.php, line 38
Contains \Drupal\support_ticket\Plugin\EntityReferenceSelection\SupportTicketSelection.

Class

SupportTicketSelection
Provides specific access control for the support ticket entity type.

Namespace

Drupal\support_ticket\Plugin\EntityReferenceSelection

Code

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

  // Adding the 'support_ticket_access' tag is sadly insufficient for support
  // tickets: core requires us to also know about the concept of 'published' and
  // 'unpublished'.
  $query
    ->condition('status', SUPPORT_TICKET_PUBLISHED);
  return $query;
}