static public function getItemsForCatalog($nb_catalog, int $level)
    {
        $nb_catalog_id = nb_getMixedValue($nb_catalog, NABU_CATALOG_FIELD_ID);
        if (is_numeric($nb_catalog_id)) {
            $retval = CNabuCatalogItem::buildObjectListFromSQL(
                NABU_CATALOG_ITEM_FIELD_ID,
                'SELECT *
                   FROM nb_catalog_item
                  WHERE nb_catalog_id=%catalog_id$d '
                . ($level > 0 ? 'AND nb_catalog_item_level<=%level$d ' : '')
                . 'ORDER BY nb_catalog_item_order ASC',
                array(
                    'catalog_id' => $nb_catalog_id,
                    'level' => $level
                ),
                ($nb_catalog instanceof CNabuCatalog ? $nb_catalog : null)
            );
            if ($nb_catalog instanceof CNabuCatalog) {
                $retval->setCatalog($nb_catalog);
            }
        } else {
            if ($nb_catalog instanceof CNabuCatalog) {
                $retval = new CNabuCatalogItemList($nb_catalog);
                $retval->setOwner($nb_catalog);
            } else  {
                $retval = new CNabuCatalogItemList();
            }
        }

        return $retval;
    }
static public function getItemsForCatalog($nb_catalog, int $level)
    {
        $nb_catalog_id = nb_getMixedValue($nb_catalog, NABU_CATALOG_FIELD_ID);
        if (is_numeric($nb_catalog_id)) {
            $retval = CNabuCatalogItem::buildObjectListFromSQL(
                NABU_CATALOG_ITEM_FIELD_ID,
                'SELECT *
                   FROM nb_catalog_item
                  WHERE nb_catalog_id=%catalog_id$d '
                . ($level > 0 ? 'AND nb_catalog_item_level<=%level$d ' : '')
                . 'ORDER BY nb_catalog_item_order ASC',
                array(
                    'catalog_id' => $nb_catalog_id,
                    'level' => $level
                ),
                ($nb_catalog instanceof CNabuCatalog ? $nb_catalog : null)
            );
            if ($nb_catalog instanceof CNabuCatalog) {
                $retval->setCatalog($nb_catalog);
            }
        } else {
            if ($nb_catalog instanceof CNabuCatalog) {
                $retval = new CNabuCatalogItemList($nb_catalog);
                $retval->setOwner($nb_catalog);
            } else  {
                $retval = new CNabuCatalogItemList();
            }
        }

        return $retval;
    }
static public function getItemsForCatalog ( $ nb_catalog , int $ level ) { $ nb_catalog_id = nb_getMixedValue ( $ nb_catalog , NABU_CATALOG_FIELD_ID ) ; if ( is_numeric ( $ nb_catalog_id ) ) { $ retval = CNabuCatalogItem :: buildObjectListFromSQL ( NABU_CATALOG_ITEM_FIELD_ID , 'SELECT *
                   FROM nb_catalog_item
                  WHERE nb_catalog_id=%catalog_id$d ' . ( $ level > 0 ? 'AND nb_catalog_item_level<=%level$d ' : '' ) . 'ORDER BY nb_catalog_item_order ASC' , array ( 'catalog_id' => $ nb_catalog_id , 'level' => $ level ) , ( $ nb_catalog instanceof CNabuCatalog ? $ nb_catalog : null ) ) ; if ( $ nb_catalog instanceof CNabuCatalog ) { $ retval -> setCatalog ( $ nb_catalog ) ; } } else { if ( $ nb_catalog instanceof CNabuCatalog ) { $ retval = new CNabuCatalogItemList ( $ nb_catalog ) ; $ retval -> setOwner ( $ nb_catalog ) ; } else { $ retval = new CNabuCatalogItemList ( ) ; } } return $ retval ; }
Gets the list of items of a catalog from the storage.
@param mixed $nb_catalog A CNabuDataObject instance containing a field name nb_catalog_id or a Catalog ID.
@param int $level Max deep level to retrieve items. If $level is 0 then retrieves all levels.
@return CNabuCatalogItemList Returns a CNabuCatalogItemList with all items found. If no items found, then
returns an empty instance.
Gets the list of items of a catalog from the storage .