You are here

public function FlagServiceInterface::getAllEntityFlaggings in Flag 8.4

Get all flaggings for the given entity, and optionally, user.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The flaggable entity.

\Drupal\Core\Session\AccountInterface $account: (optional) The account of the flagging user. If NULL, flaggings for any user will be returned.

string $session_id: (optional) The session ID. This must be supplied if $account is the anonymous user.

Return value

array An array of flaggings.

Throws

\LogicException An exception is thrown if the given $account is anonymous, but no $session_id is given.

1 method overrides FlagServiceInterface::getAllEntityFlaggings()
FlagService::getAllEntityFlaggings in src/FlagService.php
Get all flaggings for the given entity, and optionally, user.

File

src/FlagServiceInterface.php, line 128

Class

FlagServiceInterface
Flag service interface.

Namespace

Drupal\flag

Code

public function getAllEntityFlaggings(EntityInterface $entity, AccountInterface $account = NULL, $session_id = NULL);