You are here

public function FlagServiceInterface::getFlagById in Flag 8.4

Load the flag entity given the ID.

$flag = \Drupal::service('flag')
  ->getFlagById('bookmark');

Parameters

string $flag_id: The identifier of the flag to load.

Return value

\Drupal\flag\FlagInterface|null The flag entity.

1 method overrides FlagServiceInterface::getFlagById()
FlagService::getFlagById in src/FlagService.php
Load the flag entity given the ID.

File

src/FlagServiceInterface.php, line 143

Class

FlagServiceInterface
Flag service interface.

Namespace

Drupal\flag

Code

public function getFlagById($flag_id);