You are here

public function EntityType::changeBehavior in Entity Construction Kit (ECK) 7.2

Same name and namespace in other branches
  1. 7.3 eck.classes.inc \EntityType::changeBehavior()

Change the behavior of a property.

Parameters

string $name: The name of the property.

string $behavior: The name of the behavior.

1 call to EntityType::changeBehavior()
EntityType::removeBehavior in ./eck.classes.inc
Remove behavior.

File

./eck.classes.inc, line 318
Classes for all the different objects used in ECK.

Class

EntityType
An entity type database object.

Code

public function changeBehavior($name, $behavior) {
  $p = $this->properties;

  // @todo check that type is an actual type.
  if (array_key_exists($name, $p)) {
    $p[$name]['behavior'] = $behavior;

    // @todo look at this more closelly, does the behavior change really
    // affect the property cache?
    entity_property_info_cache_clear();
  }
  else {

    // @todo add exception if the property does not exist.
  }
  $this->properties = $p;
}