public function correctPath()
{
//set id path to correct value
$parentIds = [];
$parent = $this->getParent();
while ($parent) {
$parentIds[] = $parent->getId();
$parent = $parent->getParent();
}
$parentIds = array_reverse($parentIds);
if ($parentIds) {
$this->idPath = "/" . implode("/", $parentIds) . "/";
} else {
$this->idPath = "/";
}
}