You are here

public function SelectionBase::countReferencableEntities in Entity reference 8

Implements EntityReferenceHandler::countReferencableEntities().

Overrides SelectionInterface::countReferencableEntities

File

lib/Drupal/entityreference/Plugin/entityreference/selection/SelectionBase.php, line 183
Definition of Drupal\entityreference\Plugin\entityreference\selection\SelectionBase.

Class

SelectionBase
Plugin implementation of the 'selection' entityreference.

Namespace

Drupal\entityreference\Plugin\entityreference\selection

Code

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