Open tarikhagustia opened 2 years ago
Hello, i have a problem when adding nestedset to running project. my project using parentid as a parent_id key so i add this line into my model
parentid
public function getParentIdName() { return 'parentid'; }
but when running MyModel::fixTree(); some parent_id record goes NULL, i have double check that parentid was exist on database.
MyModel::fixTree();
PS . my old application using parentid 0 zero when not having a parent (root directory)
0
thanks
In NodeTraite file find:
protected function setParent($value) { $this->setParentId($value ? $value->getKey() : null) ->setRelation('parent', $value); return $this; }
Change to 0 :)
Hello, i have a problem when adding nestedset to running project. my project using
parentid
as a parent_id key so i add this line into my modelbut when running
MyModel::fixTree();
some parent_id record goes NULL, i have double check that parentid was exist on database.PS . my old application using parentid
0
zero when not having a parent (root directory)thanks