public function EntityReference::getString in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php \Drupal\Core\Entity\Plugin\DataType\EntityReference::getString()
Returns a string representation of the data.
Return value
string
Overrides DataReferenceBase::getString
File
- core/
lib/ Drupal/ Core/ Entity/ Plugin/ DataType/ EntityReference.php, line 123 - Contains \Drupal\Core\Entity\Plugin\DataType\EntityReference.
Class
- EntityReference
- Defines an 'entity_reference' data type.
Namespace
Drupal\Core\Entity\Plugin\DataTypeCode
public function getString() {
if ($entity = $this
->getValue()) {
return $entity
->label();
}
return '';
}