Represents the "get_categories_csv" action.

@throws ShopgateLibraryException
@see http://wiki.shopgate.com/Shopgate_Plugin_API_get_categories_csv
774631
protected function getCategoriesCsv()
    {
        if (isset($this->params['limit']) && isset($this->params['offset'])) {
            $this->plugin->setExportLimit((int)$this->params['limit']);
            $this->plugin->setExportOffset((int)$this->params['offset']);
            $this->plugin->setSplittedExport(true);
        }

        // generate / update categories csv file
        $this->plugin->startGetCategoriesCsv();

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseTextCsvExport($this->trace_id);
        }
        $this->responseData = $this->config->getCategoriesCsvPath();
    }
254257
protected function get_categories() {
        global $DB;
        $fields = 'c.*, ' . context_helper::get_preload_record_columns_sql('ctx');
        $coursecats = $DB->get_records_sql('SELECT ' . $fields . ' FROM {course_categories} c
                LEFT JOIN {context} ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = :contextlevel)
                WHERE c.parent = :parent ORDER BY c.sortorder',
            array('parent' => $this->category->id, 'contextlevel' => CONTEXT_COURSECAT));

        $hiddencats = [];

        foreach ($coursecats as $id => &$category) {
            context_helper::preload_from_record($category);
            if (!core_course_category::can_view_category($category)) {
                $hiddencats[$id] = $coursecats[$id];
                unset($coursecats[$id]);
            }
        }
        return [$coursecats, $hiddencats];
    }
666835
public Map<String, CmsCategory> getReadCategory() {

        if (null == m_categories) {
            m_categories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                public Object transform(Object categoryPath) {

                    try {
                        CmsCategoryService catService = CmsCategoryService.getInstance();
                        return catService.localizeCategory(
                            m_cms,
                            catService.readCategory(m_cms, (String)categoryPath, getRequestContext().getUri()),
                            m_cms.getRequestContext().getLocale());
                    } catch (CmsException e) {
                        LOG.warn(e.getLocalizedMessage(), e);
                        return null;
                    }
                }

            });
        }
        return m_categories;
    }
1254430
public function getCategories()
    {
        $apiCategories = [];
        $fileVersion = $this->getFileVersion();
        $categories = $fileVersion->getCategories();

        return array_map(function(CategoryEntity $category) {
            return $category->getId();
        }, $categories->toArray());
    }
72699
protected function getItems()
    {
        $limit        = isset($this->params['limit'])
            ? (int)$this->params['limit']
            : null;
        $offset       = isset($this->params['offset'])
            ? (int)$this->params['offset']
            : null;
        $uids         = isset($this->params['uids'])
            ? (array)$this->params['uids']
            : array();
        $responseType = isset($this->params['response_type'])
            ? $this->params['response_type']
            : false;

        $supportedResponseTypes = $this->config->getSupportedResponseTypes();
        if (!empty($responseType) && !in_array($responseType, $supportedResponseTypes['get_items'])) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::PLUGIN_API_UNSUPPORTED_RESPONSE_TYPE,
                'Requested type: "' . $responseType . '"'
            );
        }

        $this->plugin->startGetItems($limit, $offset, $uids, $responseType);

        switch ($responseType) {
            default:
            case 'xml':
                $response     = new ShopgatePluginApiResponseAppXmlExport($this->trace_id);
                $responseData = $this->config->getItemsXmlPath();
                break;

            case 'json':
                $response     = new ShopgatePluginApiResponseAppJsonExport($this->trace_id);
                $responseData = $this->config->getItemsJsonPath();
                break;
        }

        if (empty($this->response)) {
            $this->response = $response;
        }

        $this->responseData = $responseData;
    }
390710
private List<CmsCategoryBean> getCategoryList() {

        List<CmsCategoryBean> result = new ArrayList<CmsCategoryBean>();
        categoryTreeToList(result, m_dialogBean.getCategories());
        return result;
    }
346836
protected function getCategory($categoryId, $storeViewCode = StoreViewCodes::ADMIN)
    {
        return $this->getSubject()->getCategory($categoryId, $storeViewCode);
    }
882016
public function getCategories()
    {
        $categoryEntities = $this->entity->getCategories();

        $categories = [];
        if ($categoryEntities) {
            foreach ($categoryEntities as $categoryEntity) {
                $categories[] = new Category($categoryEntity, $this->locale);
            }
        }

        return $categories;
    }
255000
public CmsCategory getCategory(CmsObject cms, String categoryRootPath) throws CmsException {

        CmsResource resource = cms.readResource(cms.getRequestContext().removeSiteRoot(categoryRootPath));
        return getCategory(cms, resource);
    }
29152
def folderitems(self):
        
        items = super(ReferenceResultsView, self).folderitems()
        self.categories.sort()
        return items
825225
public function getCategories()
    {
        return (new CmsCategoryQuery)
                ->join('cms_category_relation')->on('id', 'cms_category_id')
                ->where('object', 'cms_category_relation')->equals($this->_object)
                ->where('objectId', 'cms_category_relation')->equals($this->_objectId)
                ->find();
    }
589846
public Map<String, CmsJspCategoryAccessBean> getReadAllSubCategories() {

        if (null == m_allSubCategories) {
            m_allSubCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                @Override
                public Object transform(Object categoryPath) {

                    try {
                        List<CmsCategory> categories = CmsCategoryService.getInstance().readCategories(
                            m_cms,
                            (String)categoryPath,
                            true,
                            m_cms.getRequestContext().getUri());
                        CmsJspCategoryAccessBean result = new CmsJspCategoryAccessBean(
                            m_cms,
                            categories,
                            (String)categoryPath);
                        return result;
                    } catch (CmsException e) {
                        LOG.warn(e.getLocalizedMessage(), e);
                        return null;
                    }
                }

            });
        }
        return m_allSubCategories;
    }
907964
public function getCategories()
    {
        if (null === $this->_categories) {

            $collection = Mage::getModel('catalog/category')->getCollection();

            $pathLike = Mage_Catalog_Model_Category::TREE_ROOT_ID . '/' . Mage::app()->getStore()->getRootCategoryId() . '/%';
            $collection
                ->initCache(Mage::app()->getCacheInstance(), self::class, [Mage_Catalog_Model_Category::CACHE_TAG])
                ->setStoreId(Mage::app()->getStore()->getId())
                ->addAttributeToSelect('*')
                ->addFieldToFilter('path', [
                    'like' => $pathLike,
                ])
                ->addIsActiveFilter()
                ->addAttributeToFilter('include_in_menu', 1)
                ->joinUrlRewrite();

            // Sort
            $collection->getSelect()->reset(Zend_Db_Select::ORDER);
            $collection
                ->addOrder('position', Varien_Data_Collection_Db::SORT_ORDER_ASC);

            foreach ($collection as $id => $category) {
                $this->_categories[$id] = $category;
            }
        }

        return $this->_categories;
    }
684709
public function category_listitem_actions(core_course_category $category, array $actions = null) {
        if ($actions === null) {
            $actions = \core_course\management\helper::get_category_listitem_actions($category);
        }
        $menu = new action_menu();
        $menu->attributes['class'] .= ' category-item-actions item-actions';
        $hasitems = false;
        foreach ($actions as $key => $action) {
            $hasitems = true;
            $menu->add(new action_menu_link(
                $action['url'],
                $action['icon'],
                $action['string'],
                in_array($key, array('show', 'hide', 'moveup', 'movedown')),
                array('data-action' => $key, 'class' => 'action-'.$key)
            ));
        }
        if (!$hasitems) {
            return '';
        }
        return $this->render($menu);
    }
769706
static function fetchProductCountByCategory( $categoryID )
    {
        $ini = eZINI::instance( 'shop.ini' );
        if ( !$ini->hasVariable( 'VATSettings', 'ProductCategoryAttribute' ) ||
             !$categoryAttrName = $ini->variable( 'VATSettings', 'ProductCategoryAttribute' ) )
            return 0;

        $db = eZDB::instance();
        $categoryID =(int) $categoryID;
        $categoryAttrName = $db->escapeString( $categoryAttrName );
        $query = "SELECT COUNT(*) AS count " .
                 " FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " .
                 "WHERE " .
                 " cca.id=coa.contentclassattribute_id " .
                 " AND coa.contentobject_id=co.id " .
                 " AND cca.data_type_string='ezproductcategory' " .
                 " AND cca.identifier='$categoryAttrName' " .
                 " AND coa.version=co.current_version " .
                 " AND coa.data_int=$categoryID";
        $rows = $db->arrayQuery( $query );
        return $rows[0]['count'];
    }
564164
protected function getListCategoryProduct($store_id)
    {
        $types = $this->category_group->getTypes();

        $categories = array();
        foreach (array_keys($types) as $type) {

            $op = array(
                'type' => $type,
                'store_id' => $store_id
            );

            $data = $this->getCategoryOptionsByStore($this->category, $this->category_group, $op);
            $categories[$type] = reset($data);
        }

        return $categories;
    }
259543
public function getCategoriesAttribute()
    {
        // Request category only if post type uses categories
        $getPostType = getPostType($this->getTable());

        if($getPostType->hasCategories) {
            return $this->getRelationValue('categories');
        }
        return null;
    }