public function getItemsMenuData($pageNumber, $num, $key) { $goods = new DBGoodsType(); $navKeys = new DBNavKeyType(); $treeUtils = new TreeUtils(); $navKeys->executeRequest('', '', DB::TABLE_ORDER); $tree = $treeUtils->buildTreeByLeafs(); $keys = $treeUtils->getTreeLeafesForKey($tree, $key); $goods->getGoodsKeyCount($keys); $this->dataTotalCount = $goods->getTotalCount(); $limitBegin = ($pageNumber - 1) * $num; $limitEnd = $num; if ($this->isAdminOrderEnabled()) { $goods->getUserSortedForMenu($keys, $limitBegin, $limitEnd); } else { $str = implode('|', $keys); $goods->executeRequestRegExpWithLimit(DB::TABLE_NAV_KEY__KEY_ITEM, "^(" . $str . "){1}", DB::TABLE_GOODS___ORDER, DB::ASC, $limitBegin, $limitEnd); } $this->data = $goods->getResponse(); $this->dataCount = $goods->getResponseSize(); }