public detachBehavior ( string $name ) : null | |
||
$name | string | the behavior's name. |
return | null | |
the detached behavior. Null if the behavior does not exist. |
public function detachBehavior($name)
{
$this->ensureBehaviors();
if (isset($this->_behaviors[$name])) {
$behavior = $this->_behaviors[$name];
unset($this->_behaviors[$name]);
$behavior->detach();
return $behavior;
} else {
return null;
}
}