You are here

private function EntityBlockBlock::loadEntity in Entityblock 8

Helper function to load the entity of this entityblock.

4 calls to EntityBlockBlock::loadEntity()
EntityBlockBlock::blockAccess in src/Plugin/Block/EntityBlockBlock.php
Implements \Drupal\block\BlockBase::access().
EntityBlockBlock::build in src/Plugin/Block/EntityBlockBlock.php
Implements \Drupal\block\BlockBase::blockBuild().
EntityBlockBlock::label in src/Plugin/Block/EntityBlockBlock.php
EntityBlockBlock::loadFieldValue in src/Plugin/Block/EntityBlockBlock.php
Helper function to load the field value for this entityblock.

File

src/Plugin/Block/EntityBlockBlock.php, line 147
Contains \Drupal\entityblock\Plugin\Block\EntityBlockBlock.

Class

EntityBlockBlock
Provides an entityblock block.

Namespace

Drupal\entityblock\Plugin\Block

Code

private function loadEntity() {
  $key = $this
    ->getDerivativeId();
  list($field_uuid, $entity_uuid, $delta) = explode('|', $key);
  if ($field = $this
    ->loadField()) {
    return $this->entityRepository
      ->loadEntityByUuid($field
      ->getTargetEntityTypeId(), $entity_uuid);
  }
}