You are here

public function OrganigramsBlocks::__construct in Organigrams 8

Same name in this branch
  1. 8 src/Plugin/Derivative/OrganigramsBlocks.php \Drupal\organigrams\Plugin\Derivative\OrganigramsBlocks::__construct()
  2. 8 src/Plugin/Block/OrganigramsBlocks.php \Drupal\organigrams\Plugin\Block\OrganigramsBlocks::__construct()
Same name and namespace in other branches
  1. 8.2 src/Plugin/Block/OrganigramsBlocks.php \Drupal\organigrams\Plugin\Block\OrganigramsBlocks::__construct()

Creates a OrganigramsBlocks instance.

Parameters

array $configuration: Contains the configuration.

string $plugin_id: Contains the plugin id.

array $plugin_definition: Contains the plugin definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager: Contains the entity manager.

\Drupal\organigrams\TaxonomyTermTree $taxonomyTermTree: The Taxonomy Tree builder.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/OrganigramsBlocks.php, line 53

Class

OrganigramsBlocks
Provides a 'OrganigramsBlocks' block plugin.

Namespace

Drupal\organigrams\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityTypeManagerInterface $entity_manager, TaxonomyTermTree $taxonomyTermTree) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);

  // Load the vocabulary.
  $this->taxonomyVocabulary = $entity_manager
    ->getStorage('taxonomy_vocabulary')
    ->load($this
    ->getDerivativeId());

  // Load the Taxonomy Term Tree service.
  $this->taxonomyTermTree = $taxonomyTermTree;
}