src/ShopBundle/objects/db/TShopCategoryList.class.php
public static function &GetChildCategories($iParentId = null, $aFilter = null, $sLanguageID = null)
    {
        $sActiveSnippetRestriction = TdbShopCategoryList::GetActiveCategoryQueryRestriction();
        if (is_null($iParentId)) {
            $iParentId = '';
        }
        $parameters = array(
            'parentId' => $iParentId,
        );
        $parameterType = array();

        $query = 'SELECT `shop_category`.*
                  FROM `shop_category`
                 WHERE `shop_category`.`shop_category_id` = :parentId
               ';

        if (!is_null($aFilter) && count($aFilter) > 0) {
            $parameters['filter'] = $aFilter;
            $parameterType['filter'] = Connection::PARAM_STR_ARRAY;
            $query .= ' AND `shop_category`.`id` IN (:filter) ';
        }
        if (!empty($sActiveSnippetRestriction)) {
            $query .= ' AND '.$sActiveSnippetRestriction;
        }
        $query .= ' ORDER BY `shop_category`.`position` ASC, `shop_category`.`name` ASC';

        $oCategories = new TdbShopCategoryList();
        $oCategories->SetLanguage($sLanguageID);
        $oCategories->Load($query, $parameters, $parameterType);

        return $oCategories;
    }
public static function &GetChildCategories($iParentId = null, $aFilter = null, $sLanguageID = null)
    {
        $sActiveSnippetRestriction = TdbShopCategoryList::GetActiveCategoryQueryRestriction();
        if (is_null($iParentId)) {
            $iParentId = '';
        }
        $parameters = array(
            'parentId' => $iParentId,
        );
        $parameterType = array();

        $query = 'SELECT `shop_category`.*
                  FROM `shop_category`
                 WHERE `shop_category`.`shop_category_id` = :parentId
               ';

        if (!is_null($aFilter) && count($aFilter) > 0) {
            $parameters['filter'] = $aFilter;
            $parameterType['filter'] = Connection::PARAM_STR_ARRAY;
            $query .= ' AND `shop_category`.`id` IN (:filter) ';
        }
        if (!empty($sActiveSnippetRestriction)) {
            $query .= ' AND '.$sActiveSnippetRestriction;
        }
        $query .= ' ORDER BY `shop_category`.`position` ASC, `shop_category`.`name` ASC';

        $oCategories = new TdbShopCategoryList();
        $oCategories->SetLanguage($sLanguageID);
        $oCategories->Load($query, $parameters, $parameterType);

        return $oCategories;
    }
public static function & GetChildCategories ( $ iParentId = null , $ aFilter = null , $ sLanguageID = null ) { $ sActiveSnippetRestriction = TdbShopCategoryList :: GetActiveCategoryQueryRestriction ( ) ; if ( is_null ( $ iParentId ) ) { $ iParentId = '' ; } $ parameters = array ( 'parentId' => $ iParentId , ) ; $ parameterType = array ( ) ; $ query = 'SELECT `shop_category`.*
                  FROM `shop_category`
                 WHERE `shop_category`.`shop_category_id` = :parentId
               ' ; if ( ! is_null ( $ aFilter ) && count ( $ aFilter ) > 0 ) { $ parameters [ 'filter' ] = $ aFilter ; $ parameterType [ 'filter' ] = Connection :: PARAM_STR_ARRAY ; $ query .= ' AND `shop_category`.`id` IN (:filter) ' ; } if ( ! empty ( $ sActiveSnippetRestriction ) ) { $ query .= ' AND ' . $ sActiveSnippetRestriction ; } $ query .= ' ORDER BY `shop_category`.`position` ASC, `shop_category`.`name` ASC' ; $ oCategories = new TdbShopCategoryList ( ) ; $ oCategories -> SetLanguage ( $ sLanguageID ) ; $ oCategories -> Load ( $ query , $ parameters , $ parameterType ) ; return $ oCategories ; }
returns the child categories of the category identified by iParentId
if no parent id is given, then the root categories will be returned.

@param string|null $iParentId
@param array       $aFilter     - an optional filter list for the category
@param string|null $sLanguageID

@return TdbShopCategoryList
returns the child categories of the category identified by iParentId if no parent id is given then the root categories will be returned .