function FieldItemDataDefinition::getLabel

Same name in other branches
  1. 10 core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php \Drupal\Core\Field\TypedData\FieldItemDataDefinition::getLabel()

Gets the label of the field type.

If the label hasn't been set, then fall back to the label of the typed data definition.

Return value

string The label of the field type.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides DataDefinition::getLabel

File

core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php, line 101

Class

FieldItemDataDefinition
A typed data definition class for defining field items.

Namespace

Drupal\Core\Field\TypedData

Code

public function getLabel() {
    return parent::getLabel() ?: $this->getTypedDataManager()
        ->getDefinition($this->getDataType())['label'];
}

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