public function EntityNG::get

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

Overrides Entity::get

2 calls to EntityNG::get()
EntityNG::getProperties in drupal/core/lib/Drupal/Core/Entity/EntityNG.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::getProperties().
User::getRoles in drupal/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
Returns a list of roles.

File

drupal/core/lib/Drupal/Core/Entity/EntityNG.php, line 203
Contains \Drupal\Core\Entity\EntityNG.

Class

EntityNG
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function get($property_name) {

  // Values in default language are always stored using the
  // Language::LANGCODE_DEFAULT constant.
  if (!isset($this->fields[$property_name][Language::LANGCODE_DEFAULT])) {
    return $this
      ->getTranslatedField($property_name, Language::LANGCODE_DEFAULT);
  }
  return $this->fields[$property_name][Language::LANGCODE_DEFAULT];
}