You are here

public function FlagForList::hasBaseFlag in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/Entity/FlagForList.php \Drupal\flag_lists\Entity\FlagForList::hasBaseFlag()

Check if the base_flag (template) flag exist.

Return value

bool Return the status of the base Flag.

File

src/Entity/FlagForList.php, line 143

Class

FlagForList
Defines the Flag for list entity.

Namespace

Drupal\flag_lists\Entity

Code

public function hasBaseFlag() {
  $flag_id = $this
    ->getBaseFlag();
  $flag = \Drupal::entityTypeManager()
    ->getStorage('flag')
    ->load($flag_id);
  return !empty($flag);
}