protected function getListCategory()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->category->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('group')) {
            return $this->category->getList(array('category_group_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('parent')) {
            return $this->category->getList(array('parent_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->category->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
protected function getListCategory()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->category->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('group')) {
            return $this->category->getList(array('category_group_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('parent')) {
            return $this->category->getList(array('parent_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->category->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
protected function getListCategory ( ) { $ id = $ this -> getParam ( 0 ) ; if ( ! isset ( $ id ) ) { return $ this -> category -> getList ( array ( 'limit' => $ this -> getLimit ( ) ) ) ; } if ( ! is_numeric ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } if ( $ this -> getParam ( 'group' ) ) { return $ this -> category -> getList ( array ( 'category_group_id' => $ id , 'limit' => $ this -> getLimit ( ) ) ) ; } if ( $ this -> getParam ( 'parent' ) ) { return $ this -> category -> getList ( array ( 'parent_id' => $ id , 'limit' => $ this -> getLimit ( ) ) ) ; } $ result = $ this -> category -> get ( $ id ) ; if ( empty ( $ result ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } return array ( $ result ) ; }
Returns an array of categories
@return array
Returns an array of categories