public function FlagCountManagerInterface::getEntityFlagCounts in Flag 8.4
Gets flag counts for all flags on an entity.
Provides a count of all the flaggings for a single entity. Instead of a single response, this method returns an array of counts keyed by the flag ID:
array(
my_flag => 42
another_flag => 57
);
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity.
Return value
array An array giving the counts of all flaggings on the entity. The flag IDs are the keys and the counts for each flag the values. Note that flags that have no flaggings are not included in the array.
1 method overrides FlagCountManagerInterface::getEntityFlagCounts()
- FlagCountManager::getEntityFlagCounts in src/
FlagCountManager.php - Gets flag counts for all flags on an entity.
File
- src/
FlagCountManagerInterface.php, line 35
Class
- FlagCountManagerInterface
- Interface FlagCountManagerInterface.
Namespace
Drupal\flagCode
public function getEntityFlagCounts(EntityInterface $entity);