public function DefaultSelection::countReferenceableEntities in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::countReferenceableEntities()
- 9 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::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/
lib/ Drupal/ Core/ Entity/ Plugin/ EntityReferenceSelection/ DefaultSelection.php, line 364
Class
- DefaultSelection
- Default plugin implementation of the Entity Reference Selection plugin.
Namespace
Drupal\Core\Entity\Plugin\EntityReferenceSelectionCode
public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') {
$query = $this
->buildEntityQuery($match, $match_operator);
return $query
->count()
->execute();
}