Browse Source

Merge branch 'master' of github.com:yiisoft/yii2

tags/2.0.0-beta
resurtm 12 years ago
parent
commit
3ca98d458e
  1. 2
      framework/base/Component.php

2
framework/base/Component.php

@ -496,6 +496,7 @@ class Component extends Object
*/ */
public function detachBehavior($name) public function detachBehavior($name)
{ {
$this->ensureBehaviors();
if (isset($this->_behaviors[$name])) { if (isset($this->_behaviors[$name])) {
$behavior = $this->_behaviors[$name]; $behavior = $this->_behaviors[$name];
unset($this->_behaviors[$name]); unset($this->_behaviors[$name]);
@ -511,6 +512,7 @@ class Component extends Object
*/ */
public function detachBehaviors() public function detachBehaviors()
{ {
$this->ensureBehaviors();
if ($this->_behaviors !== null) { if ($this->_behaviors !== null) {
foreach ($this->_behaviors as $name => $behavior) { foreach ($this->_behaviors as $name => $behavior) {
$this->detachBehavior($name); $this->detachBehavior($name);

Loading…
Cancel
Save