public function SelectionBase::countReferencableEntities

Implements SelectionInterface::countReferencableEntities().

Overrides SelectionInterface::countReferencableEntities

File

drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php, line 194
Contains \Drupal\entity_reference\Plugin\entity_reference\selection\SelectionBase.

Class

SelectionBase
Plugin implementation of the 'selection' entity_reference.

Namespace

Drupal\entity_reference\Plugin\entity_reference\selection

Code

public function countReferencableEntities($match = NULL, $match_operator = 'CONTAINS') {
  $query = $this
    ->buildEntityQuery($match, $match_operator);
  return $query
    ->count()
    ->execute();
}