You are here

public function FlagService::userFlagRemoval in Flag 8.4

Shared helper for user account cancellation or deletion.

Removes: All flags by the user. All flaggings of the user.

Parameters

\Drupal\user\UserInterface $account: The account of the user being cancelled or deleted.

Overrides FlagServiceInterface::userFlagRemoval

File

src/FlagService.php, line 355

Class

FlagService
Flag service.

Namespace

Drupal\flag

Code

public function userFlagRemoval(UserInterface $account) {

  // Remove flags by this user.
  $this
    ->unflagAllByUser($account);

  // Remove flags that have been done to this user.
  $this
    ->unflagAllByEntity($account);
}