You are here

protected function BlockContentBlock::getEntity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block_content/src/Plugin/Block/BlockContentBlock.php \Drupal\block_content\Plugin\Block\BlockContentBlock::getEntity()

Loads the block content entity of the block.

Return value

\Drupal\block_content\BlockContentInterface|null The block content entity.

2 calls to BlockContentBlock::getEntity()
BlockContentBlock::blockAccess in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Indicates whether the block should be shown.
BlockContentBlock::build in core/modules/block_content/src/Plugin/Block/BlockContentBlock.php
Builds and returns the renderable array for this block plugin.

File

core/modules/block_content/src/Plugin/Block/BlockContentBlock.php, line 185
Contains \Drupal\block_content\Plugin\Block\BlockContentBlock.

Class

BlockContentBlock
Defines a generic custom block type.

Namespace

Drupal\block_content\Plugin\Block

Code

protected function getEntity() {
  $uuid = $this
    ->getDerivativeId();
  if (!isset($this->blockContent)) {
    $this->blockContent = $this->entityManager
      ->loadEntityByUuid('block_content', $uuid);
  }
  return $this->blockContent;
}