Open otr-tomek opened 7 years ago
Did you find a solution @otr-tomek ? Searching for the same!
Nah. In model I use with trait, I had to create:
public function newCollection(array $models = array())
{
return new Extensions\AppCollection($models);
}
You can overwrite (or copy) functions from Kalnoy\Nestedset\NodeTrait. Like: getLftName(), getRgtName(), boot() functions
Pfah. Thats kind of counter-productive ;)
It's great that You use
trait
instead of main model classextends
.Is there other way to use own/custom
Collection
than extending:MyCollection extends Kalnoy\Nestedset\Collection as Collection
and overwritingnewCollection()
function?By the way - when You set 'parent_id' to zero '0' (I had a bug in my view in option/dropdown list) - after save, tree position is updated too.