1 entity.class.inc public Entity::getFieldValue($field_name, $value_key = 'value', $langcode = NULL)

Implements EntityInterface::getFieldValue().

Overrides EntityInterface::getFieldValue

File

core/modules/entity/entity.class.inc, line 342
Provides an interface and a base class for entities.

Class

Entity
Defines a base entity class.

Code

public function getFieldValue($field_name, $value_key = 'value', $langcode = NULL) {
  $values = $this->getFieldValues($field_name, $value_key, $langcode);
  return empty($values) ? NULL : reset($values);
}