Closed bethrezen closed 12 years ago
shouldn't we throw an exception to complain about the unsaved record instead of returning null
?
Didn't check that in detail but when parent is null I'd interpret it as if it's a root node.
Maybe you are right
Wontfix. It can be useful in next scenario:
$model=new Category;
$model->lft=2;
$model->rgt=7;
$model->parent()->find();
like native feature of framework:
$model=new Foo;
$model->bar_id=1;
$model->bar; // returns bar relation
While getting parent of node: if it is new and unsaved node - parent can't be retrieven, because we don't have rgt and lft