You are here

protected function FieldInheritancePluginBase::inheritData in Field Inheritance 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/FieldInheritance/FieldInheritancePluginBase.php \Drupal\field_inheritance\Plugin\FieldInheritance\FieldInheritancePluginBase::inheritData()

Retrieve inherited data.

Return value

string The inherited data.

1 call to FieldInheritancePluginBase::inheritData()
FieldInheritancePluginBase::computeValue in src/Plugin/FieldInheritance/FieldInheritancePluginBase.php
Compute the value of the field.

File

src/Plugin/FieldInheritance/FieldInheritancePluginBase.php, line 227

Class

FieldInheritancePluginBase
Abstract class FieldInheritancePluginBase.

Namespace

Drupal\field_inheritance\Plugin\FieldInheritance

Code

protected function inheritData() {
  $source_entity = $this
    ->getSourceEntity();
  if ($source_entity === FALSE) {
    return [];
  }
  return $source_entity->{$this
    ->getSourceField()}
    ->getValue() ?? '';
}