You are here

protected function BlockBase::getBlock in Display Suite 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/DsField/BlockBase.php \Drupal\ds\Plugin\DsField\BlockBase::getBlock()
  2. 8.3 src/Plugin/DsField/BlockBase.php \Drupal\ds\Plugin\DsField\BlockBase::getBlock()

Return the block entity.

2 calls to BlockBase::getBlock()
BlockBase::build in src/Plugin/DsField/BlockBase.php
Renders a field.
DynamicBlockField::getTitle in src/Plugin/DsField/DynamicBlockField.php
Returns the title of the block.

File

src/Plugin/DsField/BlockBase.php, line 163

Class

BlockBase
The base plugin to create DS block fields.

Namespace

Drupal\ds\Plugin\DsField

Code

protected function getBlock() {
  if (!$this->block) {

    // Create an instance of the block.

    /* @var $block BlockPluginInterface */
    $block_id = $this
      ->blockPluginId();
    $block = $this->blockManager
      ->createInstance($block_id);
    $this->block = $block;
  }
  return $this->block;
}