You are here

public function ViewsSelection::countReferenceableEntities in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::countReferenceableEntities()

Counts entities that are referenceable.

Parameters

string $match: (optional) Text to match the label against. Defaults to NULL.

string $match_operator: (optional) Operator to be used for string matching. Defaults to "CONTAINS".

Return value

int The number of referenceable entities.

Overrides SelectionInterface::countReferenceableEntities

File

core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php, line 298

Class

ViewsSelection
Plugin implementation of the 'selection' entity_reference.

Namespace

Drupal\views\Plugin\EntityReferenceSelection

Code

public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') {
  $this
    ->getReferenceableEntities($match, $match_operator);
  return $this->view->pager
    ->getTotalItems();
}