function LanguageReference::getTargetIdentifier

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

Overrides DataReferenceInterface::getTargetIdentifier

File

core/lib/Drupal/Core/TypedData/Plugin/DataType/LanguageReference.php, line 28

Class

LanguageReference
Defines the 'language_reference' data type.

Namespace

Drupal\Core\TypedData\Plugin\DataType

Code

public function getTargetIdentifier() {
    $language = $this->getTarget();
    return isset($language) ? $language->id() : NULL;
}

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