protected function SimpleBlockBlock::getEntity in Simple Block 8
Loads the block config entity of the block, if any.
Return value
\Drupal\simple_block\SimpleBlockInterface|null The block config entity.
1 call to SimpleBlockBlock::getEntity()
- SimpleBlockBlock::build in src/
Plugin/ Block/ SimpleBlockBlock.php - Builds and returns the renderable array for this block plugin.
File
- src/
Plugin/ Block/ SimpleBlockBlock.php, line 139
Class
- SimpleBlockBlock
- Defines a generic custom block config type.
Namespace
Drupal\simple_block\Plugin\BlockCode
protected function getEntity() : ?SimpleBlockInterface {
if (!isset($this->entity)) {
$this->entity = $this->entityTypeManager
->getStorage('simple_block')
->load($this
->getDerivativeId());
}
return $this->entity;
}