public function updateLevelForChildrenElements($object)
    {

        $tmp = new \Doctrine\Common\Collections\ArrayCollection();

        $children = $this->findChildrenByParentId($object->getId());

        foreach ($children as $ch) {
            $tmp->add($ch);
        }

        while (!$tmp->isEmpty()) {
            $d = $tmp->first();
            $tmp->removeElement($d);
            $children = $d->getChildren();
            foreach ($children as $ch) {
                $tmp->add($ch);
            }
            $parent = $d->getParent();
            $d->setLevel($parent->getLevel() + 1);
            $this->updateWithoutPreAndPostUpdate($d);
        }

    }