You are here

private function EntityBlockBlock::loadFieldValue in Entityblock 8

Helper function to load the field value for this entityblock.

2 calls to EntityBlockBlock::loadFieldValue()
EntityBlockBlock::build in src/Plugin/Block/EntityBlockBlock.php
Implements \Drupal\block\BlockBase::blockBuild().
EntityBlockBlock::label in src/Plugin/Block/EntityBlockBlock.php

File

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

Class

EntityBlockBlock
Provides an entityblock block.

Namespace

Drupal\entityblock\Plugin\Block

Code

private function loadFieldValue() {
  $key = $this
    ->getDerivativeId();
  list($field_uuid, $entity_uuid, $delta) = explode('|', $key);
  $entity = $this
    ->loadEntity();
  $field = $this
    ->loadField();
  return $entity ? $entity->{$field
    ->getName()}
    ->get($delta) : NULL;
}