You are here

public function FieldableEntityStorageInterface::countFieldData in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData()
  2. 9 core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php \Drupal\Core\Entity\FieldableEntityStorageInterface::countFieldData()

Determines the number of entities with values for a given field.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field for which to count data records.

bool $as_bool: (Optional) Optimizes the query for checking whether there are any records or not. Defaults to FALSE.

Return value

bool|int The number of entities. If $as_bool parameter is TRUE then the value will either be TRUE or FALSE.

See also

\Drupal\Core\Entity\FieldableEntityStorageInterface::purgeFieldData()

2 methods override FieldableEntityStorageInterface::countFieldData()
ContentEntityNullStorage::countFieldData in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Determines the number of entities with values for a given field.
SqlContentEntityStorage::countFieldData in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
Determines the number of entities with values for a given field.

File

core/lib/Drupal/Core/Entity/FieldableEntityStorageInterface.php, line 28

Class

FieldableEntityStorageInterface
A storage that supports entity types with field definitions.

Namespace

Drupal\Core\Entity

Code

public function countFieldData($storage_definition, $as_bool = FALSE);