You are here

protected function SimpleFacebookPixelSettingsForm::getFlags in Simple Facebook Pixel 8

Gets a list of available flags.

Return value

array An array of flags.

1 call to SimpleFacebookPixelSettingsForm::getFlags()
SimpleFacebookPixelSettingsForm::buildForm in src/Form/SimpleFacebookPixelSettingsForm.php
Form constructor.

File

src/Form/SimpleFacebookPixelSettingsForm.php, line 393

Class

SimpleFacebookPixelSettingsForm
Class SimpleFacebookPixelSettingsForm.

Namespace

Drupal\simple_facebook_pixel\Form

Code

protected function getFlags() {
  $flags_list = [];
  if ($this->moduleHandler
    ->moduleExists('flag')) {
    $flags = \Drupal::service('flag')
      ->getAllFlags('commerce_product');
    foreach ($flags as $flag) {
      $flags_list[$flag
        ->id()] = $flag
        ->label();
    }
  }
  return $flags_list;
}