public function populate(int $deep = 0)
    {
        $nb_catalog = $this->getCatalog();
        $this->clear();
        $this->merge(CNabuCatalogItem::getItemsForCatalog($nb_catalog, $deep));
        $translations = CNabuCatalogItem::getItemTranslationsForCatalog($nb_catalog, $deep);
        $translations->iterate(
            function ($key, $translation)
            {
                $item = $this->getItem($translation->getCatalogItemId());
                if ($item instanceof INabuTranslated) {
                    $item->setTranslation($translation);
                }
                return true;
            }
        );
    }
public function populate(int $deep = 0)
    {
        $nb_catalog = $this->getCatalog();
        $this->clear();
        $this->merge(CNabuCatalogItem::getItemsForCatalog($nb_catalog, $deep));
        $translations = CNabuCatalogItem::getItemTranslationsForCatalog($nb_catalog, $deep);
        $translations->iterate(
            function ($key, $translation)
            {
                $item = $this->getItem($translation->getCatalogItemId());
                if ($item instanceof INabuTranslated) {
                    $item->setTranslation($translation);
                }
                return true;
            }
        );
    }
public function populate ( int $ deep = 0 ) { $ nb_catalog = $ this -> getCatalog ( ) ; $ this -> clear ( ) ; $ this -> merge ( CNabuCatalogItem :: getItemsForCatalog ( $ nb_catalog , $ deep ) ) ; $ translations = CNabuCatalogItem :: getItemTranslationsForCatalog ( $ nb_catalog , $ deep ) ; $ translations -> iterate ( function ( $ key , $ translation ) { $ item = $ this -> getItem ( $ translation -> getCatalogItemId ( ) ) ; if ( $ item instanceof INabuTranslated ) { $ item -> setTranslation ( $ translation ) ; } return true ; } ) ; }
Populates the catalog with all Items.
@param int $deep If 0 all items are retrieved, else if great of 0, then retrieves only the first $deep levels.
Populates the catalog with all Items .