You are here

protected function EntityStructureWrapper::getPropertyValue in Entity API 7

Gets the value of a property.

1 call to EntityStructureWrapper::getPropertyValue()
EntityStructureWrapper::getPropertyRaw in includes/entity.wrapper.inc
Gets the raw value of a property.

File

includes/entity.wrapper.inc, line 459
Provides wrappers allowing easy usage of the entity metadata.

Class

EntityStructureWrapper
Provides a general wrapper for any data structure. For this to work the metadata has to be passed during construction.

Code

protected function getPropertyValue($name, &$info) {
  $options = array(
    'language' => $this
      ->getPropertyLanguage(),
    'absolute' => TRUE,
  );
  $data = $this
    ->value();
  if (!isset($data)) {
    throw new EntityMetadataWrapperException('Unable to get the data property ' . check_plain($name) . ' as the parent data structure is not set.');
  }
  return $info['getter callback']($data, $options, $name, $this->type, $info);
}