You are here

public function FlagCountManagerInterface::getUserFlagFlaggingCount in Flag 8.4

Gets the count of the flaggings made by a user with a flag.

For example, with a 'bookmarks' flag, this returns the number of bookmarks a user has created.

Parameters

\Drupal\flag\FlagInterface $flag: The flag.

\Drupal\Core\Session\AccountInterface $user: The account.

string $session_id: (optional) The session ID used to specify a unique anonymous user.

Return value

int The number of flaggings for the given flag and user.

Throws

\LogicException Throws an exception if $account is the anonymous user but $session_id is NULL.

1 method overrides FlagCountManagerInterface::getUserFlagFlaggingCount()
FlagCountManager::getUserFlagFlaggingCount in src/FlagCountManager.php
Gets the count of the flaggings made by a user with a flag.

File

src/FlagCountManagerInterface.php, line 88

Class

FlagCountManagerInterface
Interface FlagCountManagerInterface.

Namespace

Drupal\flag

Code

public function getUserFlagFlaggingCount(FlagInterface $flag, AccountInterface $user, $session_id = NULL);