/** * @inheritdoc * * Additionally, tracks attached behaviors to allow iterating over them. */ public function detachBehavior($name) { if (isset($this->_behaviors[$name])) { unset($this->_behaviors[$name]); } unset(self::$_names[get_class($this)]); return parent::detachBehavior($name); }