function BlockContentBlock::getEntity
Loads the block content entity of the block.
Return value
\Drupal\block_content\BlockContentInterface|null The block content entity.
3 calls to BlockContentBlock::getEntity()
- BlockContentBlock::blockAccess in core/
modules/ block_content/ src/ Plugin/ Block/ BlockContentBlock.php - Indicates whether the block should be shown.
- BlockContentBlock::blockForm in core/
modules/ block_content/ src/ Plugin/ Block/ BlockContentBlock.php - 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 140
Class
- BlockContentBlock
- Defines a generic block type.
Namespace
Drupal\block_content\Plugin\BlockCode
protected function getEntity() {
if (!isset($this->blockContent)) {
$uuid = $this->getDerivativeId();
if ($id = $this->uuidLookup
->get($uuid)) {
$this->blockContent = $this->entityTypeManager
->getStorage('block_content')
->load($id);
}
}
/** @var \Drupal\block_content\BlockContentInterface|null */
return $this->entityRepository
->getTranslationFromContext($this->blockContent);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.