function BlockVariantTrait::getBlockManager

Same name in other branches
  1. 4.0.x src/Plugin/BlockVariantTrait.php \Drupal\ctools\Plugin\BlockVariantTrait::getBlockManager()

Gets the block plugin manager.

Return value

\Drupal\Core\Block\BlockManager The block plugin manager.

1 call to BlockVariantTrait::getBlockManager()
BlockVariantTrait::getBlockCollection in src/Plugin/BlockVariantTrait.php
Returns the block plugins used for this display variant.

File

src/Plugin/BlockVariantTrait.php, line 123

Class

BlockVariantTrait
Provides methods for \Drupal\ctools\Plugin\BlockVariantInterface.

Namespace

Drupal\ctools\Plugin

Code

protected function getBlockManager() {
    if (!$this->blockManager) {
        $this->blockManager = \Drupal::service('plugin.manager.block');
    }
    return $this->blockManager;
}