You are here

protected function FlagCountManager::resetLoadedCounts in Flag 8.4

Resets loaded flag counts.

Parameters

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

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

2 calls to FlagCountManager::resetLoadedCounts()
FlagCountManager::decrementFlagCounts in src/FlagCountManager.php
Decrements count of flagged entities.
FlagCountManager::incrementFlagCounts in src/FlagCountManager.php
Increments count of flagged entities.

File

src/FlagCountManager.php, line 313

Class

FlagCountManager
Class FlagCountManager.

Namespace

Drupal\flag

Code

protected function resetLoadedCounts(EntityInterface $entity, FlagInterface $flag) {

  // @todo Consider updating them instead of just clearing it.
  unset($this->entityCounts[$entity
    ->getEntityTypeId()][$entity
    ->id()]);
  unset($this->flagCounts[$flag
    ->id()]);
  unset($this->flagEntityCounts[$flag
    ->id()]);
  unset($this->userFlagCounts[$flag
    ->id()]);
}