You are here

public function FlagInterface::isFlagged in Flag 8.4

Returns true of there's a flagging for this flag and the given entity.

Parameters

EntityInterface $entity: The flaggable entity.

AccountInterface $account: (optional) The account of the user that flagged the entity.

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

Return value

bool True if the given entity is flagged, FALSE otherwise.

Throws

\LogicException Thrown when $account is anonymous but no associated session ID is specified.

1 method overrides FlagInterface::isFlagged()
Flag::isFlagged in src/Entity/Flag.php
Returns true of there's a flagging for this flag and the given entity.

File

src/FlagInterface.php, line 53

Class

FlagInterface
Defines the interface for Flag entities.

Namespace

Drupal\flag

Code

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