Implements ComplexDataInterface::getPropertyDefinition().
Overrides Entity::getPropertyDefinition
public function getPropertyDefinition($name) {
// First try getting property definitions which apply to all entities of
// this type. Then if this fails add in definitions of optional properties
// as well. That way we can use property definitions of base properties
// when determining the optional properties of an entity.
$definitions = entity_get_controller($this->entityType)
->getFieldDefinitions(array());
if (isset($definitions[$name])) {
return $definitions[$name];
}
// Add in optional properties if any.
if ($definitions = $this
->getPropertyDefinitions()) {
return isset($definitions[$name]) ? $definitions[$name] : FALSE;
}
}