mirror of
https://github.com/Oreolek/yii2-nested-sets.git
synced 2024-07-05 16:04:23 +03:00
Replace init with attach
On `init()` stage there's no owner(it is null). Owner appears on `attach()`.
This commit is contained in:
parent
b0a6b3ea10
commit
34a081e929
|
@ -80,9 +80,9 @@ class NestedSet extends Behavior
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function attach($owner)
|
||||||
{
|
{
|
||||||
parent::init();
|
parent::attach($owner);
|
||||||
self::$_cached[get_class($this->owner)][$this->_id = self::$_c++] = $this->owner;
|
self::$_cached[get_class($this->owner)][$this->_id = self::$_c++] = $this->owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue