yii\base\Component::detachBehavior PHP Метод

detachBehavior() публичный Метод

The behavior's [[Behavior::detach()]] method will be invoked.
public detachBehavior ( string $name ) : null | Behavior
$name string the behavior's name.
Результат null | Behavior 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;
        }
    }