You are here

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

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

Remove a property.

Parameters

string $name: The name of the property.

File

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

Class

EntityType
An entity type database object.

Code

public function removeProperty($name) {
  $p = $this->properties;
  if (array_key_exists($name, $p)) {

    // Let the behaviors execute some code.
    eck_property_behavior_invoke_plugin($this, 'property_remove', array(
      'name' => $name,
      'property' => $p[$name],
      'entity_type' => $this,
    ));
    unset($p[$name]);
    $this->properties = $p;
    if (!$this->isNew) {
      $this
        ->recordFieldChange('remove', $name);
    }
  }
}