public function EntityStructureWrapper::getPropertyInfo in Entity API 7
Gets the info about the given property.
Parameters
$name: The name of the property. If not given, info about all properties will be returned.
Return value
array An array of info about the property.
Throws
EntityMetadataWrapperException If there is no such property.
3 calls to EntityStructureWrapper::getPropertyInfo()
- EntityStructureWrapper::get in includes/
entity.wrapper.inc - Get the wrapper for a property.
- EntityStructureWrapper::propertyAccess in includes/
entity.wrapper.inc - EntityStructureWrapper::setProperty in includes/
entity.wrapper.inc - Sets a property.
File
- includes/
entity.wrapper.inc, line 353 - 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
public function getPropertyInfo($name = NULL) {
$this
->spotInfo();
if (!isset($name)) {
return $this->propertyInfo['properties'];
}
if (!isset($this->propertyInfo['properties'][$name])) {
throw new EntityMetadataWrapperException('Unknown data property ' . check_plain($name) . '.');
}
return $this->propertyInfo['properties'][$name] + $this->info['property defaults'] + $this->propertyInfoDefaults;
}