You are here

protected function EntityStructureWrapper::getPropertyRaw in Entity API 7

Gets the raw value of a property.

File

includes/entity.wrapper.inc, line 471
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 getPropertyRaw($name, &$info) {
  if (!empty($info['raw getter callback'])) {
    $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['raw getter callback']($data, $options, $name, $this->type, $info);
  }
  return $this
    ->getPropertyValue($name, $info);
}