You are here

public function FlagCount::__construct in Flag 8.4

Constructs \Drupal\flag\TwigExtension\FlagCount.

Parameters

\Drupal\flag\FlagCountManagerInterface $flag_count: The flag count service.

File

src/TwigExtension/FlagCount.php, line 27

Class

FlagCount
Provides a Twig extension to get the flag count given a flag and flaggable.

Namespace

Drupal\flag\TwigExtension

Code

public function __construct($flag_count) {
  if (func_num_args() == 5) {
    $flag_count = func_get_arg(4);
    if (!$flag_count instanceof FlagCountManagerInterface) {
      $flag_count = \Drupal::service('flag.count');
    }
  }
  $this->flagCount = $flag_count;
}