You are here

public function ComputedFieldItem::executeDisplayCode in Computed Field 8

File

src/Plugin/Field/FieldType/ComputedFieldItem.php, line 240

Class

ComputedFieldItem
Plugin implementation of the 'computed' field type.

Namespace

Drupal\computed_field\Plugin\Field\FieldType

Code

public function executeDisplayCode() {
  $code = $this
    ->getSetting('display_code');
  $entity_manager = \Drupal::EntityManager();
  $entity = $this
    ->getEntity();
  $fields = $this
    ->getEntity()
    ->toArray();
  $value = $this
    ->get('value')
    ->getValue();
  $display_output = NULL;
  eval($code);
  return $display_output;
}