public function makeFullpath(Page $page)
    {
        if ($page->getParent() === NULL)
        {
            $page->setFullpath('');
            $page->setSlug('');
        }
        else
        {
            $parentFullpath = $page->getParent()->getFullpath();
            $slug = $this->addSuffixNumber($page->getSlug(), $page);
            $page->setFullpath(($parentFullpath != '' ? ($parentFullpath . '/') : '') . $slug);
            $page->setSlug($slug);
            if ($page->hasChildren())
            {
                foreach ($page->getChildren() as $children)
                {
                    $this->makeFullpath($children);
                    $this->doctrine->getManager()->persist($children);
                }
            }
        }
    }
public function makeFullpath(Page $page)
    {
        if ($page->getParent() === NULL)
        {
            $page->setFullpath('');
            $page->setSlug('');
        }
        else
        {
            $parentFullpath = $page->getParent()->getFullpath();
            $slug = $this->addSuffixNumber($page->getSlug(), $page);
            $page->setFullpath(($parentFullpath != '' ? ($parentFullpath . '/') : '') . $slug);
            $page->setSlug($slug);
            if ($page->hasChildren())
            {
                foreach ($page->getChildren() as $children)
                {
                    $this->makeFullpath($children);
                    $this->doctrine->getManager()->persist($children);
                }
            }
        }
    }
public function makeFullpath ( Page $ page ) { if ( $ page -> getParent ( ) === NULL ) { $ page -> setFullpath ( '' ) ; $ page -> setSlug ( '' ) ; } else { $ parentFullpath = $ page -> getParent ( ) -> getFullpath ( ) ; $ slug = $ this -> addSuffixNumber ( $ page -> getSlug ( ) , $ page ) ; $ page -> setFullpath ( ( $ parentFullpath != '' ? ( $ parentFullpath . '/' ) : '' ) . $ slug ) ; $ page -> setSlug ( $ slug ) ; if ( $ page -> hasChildren ( ) ) { foreach ( $ page -> getChildren ( ) as $ children ) { $ this -> makeFullpath ( $ children ) ; $ this -> doctrine -> getManager ( ) -> persist ( $ children ) ; } } } }
Init page full path and check if it doesn't already exist

@param Page $page
Init page full path and check if it doesn t already exist