function DataReferenceBase::getValue

Same name in other branches
  1. 9 core/lib/Drupal/Core/TypedData/DataReferenceBase.php \Drupal\Core\TypedData\DataReferenceBase::getValue()
  2. 10 core/lib/Drupal/Core/TypedData/DataReferenceBase.php \Drupal\Core\TypedData\DataReferenceBase::getValue()
  3. 11.x core/lib/Drupal/Core/TypedData/DataReferenceBase.php \Drupal\Core\TypedData\DataReferenceBase::getValue()

Overrides TypedData::getValue

2 calls to DataReferenceBase::getValue()
EntityReference::getString in core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
Returns a string representation of the data.
EntityReference::getTargetIdentifier in core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
Gets the identifier of the referenced data.

File

core/lib/Drupal/Core/TypedData/DataReferenceBase.php, line 36

Class

DataReferenceBase
Base class for typed data references.

Namespace

Drupal\Core\TypedData

Code

public function getValue() {
    if ($target = $this->getTarget()) {
        return $target->getValue();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.