You are here

protected function TransactionOperationSelection::buildEntityQuery in Transaction 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

src/Plugin/EntityReferenceSelection/TransactionOperationSelection.php, line 23

Class

TransactionOperationSelection
Provides specific access control for transaction operation.

Namespace

Drupal\transaction\Plugin\EntityReferenceSelection

Code

protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
  $query = parent::buildEntityQuery($match, $match_operator);
  $configuration = $this
    ->getConfiguration();
  if (isset($configuration['entity'])) {
    $query
      ->condition('transaction_type', $configuration['entity']
      ->getTypeId());
  }
  return $query;
}