public function populate(int $deep = 0)
    {
        $nb_site = $this->getSite();
        $this->merge(CNabuSiteMap::getMapsForSite($nb_site));
        $translations = CNabuSiteMapLanguage::getMapTranslationsForSite($nb_site);
        if (is_array($translations) && count($translations) > 0) {
            foreach ($translations as $translation) {
                $item = $this->getItem($translation->getSiteMapId());
                $item->setTranslation($translation);
            }
        }
        $roles = CNabuSiteMapRole::getMapRolesForSite($nb_site);
        if (is_array($roles) && count($roles) > 0) {
            foreach ($roles as $role) {
                $item = $this->getItem($role->getSiteMapId());
                $item->addRole($role);
            }
        }
    }
public function populate(int $deep = 0)
    {
        $nb_site = $this->getSite();
        $this->merge(CNabuSiteMap::getMapsForSite($nb_site));
        $translations = CNabuSiteMapLanguage::getMapTranslationsForSite($nb_site);
        if (is_array($translations) && count($translations) > 0) {
            foreach ($translations as $translation) {
                $item = $this->getItem($translation->getSiteMapId());
                $item->setTranslation($translation);
            }
        }
        $roles = CNabuSiteMapRole::getMapRolesForSite($nb_site);
        if (is_array($roles) && count($roles) > 0) {
            foreach ($roles as $role) {
                $item = $this->getItem($role->getSiteMapId());
                $item->addRole($role);
            }
        }
    }
public function populate ( int $ deep = 0 ) { $ nb_site = $ this -> getSite ( ) ; $ this -> merge ( CNabuSiteMap :: getMapsForSite ( $ nb_site ) ) ; $ translations = CNabuSiteMapLanguage :: getMapTranslationsForSite ( $ nb_site ) ; if ( is_array ( $ translations ) && count ( $ translations ) > 0 ) { foreach ( $ translations as $ translation ) { $ item = $ this -> getItem ( $ translation -> getSiteMapId ( ) ) ; $ item -> setTranslation ( $ translation ) ; } } $ roles = CNabuSiteMapRole :: getMapRolesForSite ( $ nb_site ) ; if ( is_array ( $ roles ) && count ( $ roles ) > 0 ) { foreach ( $ roles as $ role ) { $ item = $ this -> getItem ( $ role -> getSiteMapId ( ) ) ; $ item -> addRole ( $ role ) ; } } }
Populates the Site Map with all Items.
@param int $deep If 0 all items are retrieved, else if great than 0, then retrieves only the first $deep levels.
Populates the Site Map with all Items .