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. 8.9.x core/lib/Drupal/Core/TypedData/Plugin/DataType/LanguageReference.php \Drupal\Core\TypedData\Plugin\DataType\LanguageReference::getTargetIdentifier()
  3. 10 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 31

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.