function EntityReference::getString
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php \Drupal\Core\Entity\Plugin\DataType\EntityReference::getString()
- 10 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php \Drupal\Core\Entity\Plugin\DataType\EntityReference::getString()
- 11.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php \Drupal\Core\Entity\Plugin\DataType\EntityReference::getString()
Overrides DataReferenceBase::getString
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ DataType/ EntityReference.php, line 120
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 '';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.