function EntityAdapter::getString

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getString()
  2. 8.9.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getString()
  3. 11.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getString()

Overrides TypedData::getString

File

core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php, line 147

Class

EntityAdapter
Defines the "entity" data type.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

public function getString() {
    return isset($this->entity) ? $this->entity
        ->label() : '';
}

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