You are here

function entity_property_setter_method in Entity API 7

Sets the property to the given value using the setter method. May be used as 'setter callback'.

1 call to entity_property_setter_method()
entity_metadata_setter_method in includes/entity.property.inc
Deprecated. Do not make use of this function, instead use the new one.

File

includes/entity.property.inc, line 441
Provides API functions around hook_entity_property_info(). Also see entity.info.inc, which cares for providing entity property info for all core entity types.

Code

function entity_property_setter_method($object, $name, $value) {

  // Remove any underscores as classes are expected to use CamelCase.
  $method = 'set' . strtr($name, array(
    '_' => '',
  ));

  // Invoke the setProperty() method where 'Property' is the property name.
  $object
    ->{$method}($value);
}