public function EntityTranslation::get

Implements \Drupal\Core\TypedData\ComplexDataInterface::get().

Overrides ComplexDataInterface::get

2 calls to EntityTranslation::get()
EntityTranslation::getProperties in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::getProperties().
EntityTranslation::__get in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php
Magic method: Gets a translated field.

File

drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php, line 98
Contains \Drupal\Core\Entity\Type\EntityTranslation.

Class

EntityTranslation
Allows accessing and updating translated entity fields.

Namespace

Drupal\Core\Entity\Field\Type

Code

public function get($property_name) {
  $definitions = $this
    ->getPropertyDefinitions();
  if (!isset($definitions[$property_name])) {
    throw new InvalidArgumentException(format_string('Field @name is unknown or not translatable.', array(
      '@name' => $property_name,
    )));
  }
  return $this->fields[$property_name];
}