You are here

protected function FieldFormatterConditionBase::getEntity in Field Formatter Condition 8

Check for entity in build.

Parameters

array $build: The current build array.

4 calls to FieldFormatterConditionBase::getEntity()
HideIfAuthor::access in src/Plugin/Field/FieldFormatter/Condition/HideIfAuthor.php
Access control function.
HideIfBoolCheck::access in src/Plugin/Field/FieldFormatter/Condition/HideIfBoolCheck.php
Access control function.
HideIfEmpty::access in src/Plugin/Field/FieldFormatter/Condition/HideIfEmpty.php
Access control function.
HideNotEmpty::access in src/Plugin/Field/FieldFormatter/Condition/HideNotEmpty.php
Access control function.

File

src/Plugin/FieldFormatterConditionBase.php, line 96

Class

FieldFormatterConditionBase
Base class for Field formatter condition plugins.

Namespace

Drupal\fico\Plugin

Code

protected function getEntity(array $build) {
  if (!($type = $this
    ->getEntityType($build))) {
    return FALSE;
  }
  return is_object($build['#' . $this
    ->getEntityType($build)]) ? $build['#' . $this
    ->getEntityType($build)] : NULL;
}