1
0
Fork 0
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:
Alexander Kozhevnikov 2014-01-17 11:05:06 +03:00
parent b0a6b3ea10
commit 34a081e929

View file

@ -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;
}