function LanguageReference::getTargetIdentifier

Gets the identifier of the referenced data.

Return value

int|string|null The identifier of the referenced data, or NULL if the reference is unset.

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.