mirror of
https://github.com/Oreolek/yii2-nested-sets.git
synced 2024-07-01 05:55:00 +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
|
||||
*/
|
||||
public function init()
|
||||
public function attach($owner)
|
||||
{
|
||||
parent::init();
|
||||
parent::attach($owner);
|
||||
self::$_cached[get_class($this->owner)][$this->_id = self::$_c++] = $this->owner;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue