loadCategoryArticles loads 'Category Articles' rss data

@param \OxidEsales\Eshop\Application\Model\Category $oCat category object

@access public

@return void
503694
public function loadCategoryArticles(\OxidEsales\Eshop\Application\Model\Category $oCat)
    {
        $sId = $oCat->getId();
        if (($this->_aChannel = $this->_loadFromCache(self::RSS_CATARTS . $sId))) {
            return;
        }

        $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $oArtList->setCustomSorting('oc.oxtimestamp desc');
        $oArtList->loadCategoryArticles($oCat->getId(), null, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount'));

        $oLang = Registry::getLang();
        $this->_loadData(
            self::RSS_CATARTS . $sId,
            $this->getCategoryArticlesTitle($oCat),
            sprintf($oLang->translateString('S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value),
            $this->_getArticleItems($oArtList),
            $this->getCategoryArticlesUrl($oCat),
            $oCat->getLink()
        );
    }
844723
protected function _getCategory($oArticle, $iLang)
    {
        $oCat = null;
        $oView = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView();
        if ($oView instanceof \OxidEsales\Eshop\Application\Controller\FrontendController) {
            $oCat = $oView->getActiveCategory();
        } elseif ($oView instanceof \OxidEsales\Eshop\Core\Controller\BaseController) {
            $oCat = $oView->getActCategory();
        }

        return $oCat;
    }
119335
public function loadCategory($categoryId, \DmsLoaderParams $params)
  {
    $objCategory = $this->Database->prepare("SELECT * FROM tl_dms_categories WHERE id = ?")
                    ->limit(1)
                    ->execute($categoryId);
    
    $category = null;
    if ($objCategory->numRows)
    {
      $category = $this->buildCategory($objCategory);
      if ($params->loadAccessRights)
      {
        $category->accessRights = $this->getAccessRights($category, $params);
      }
      if ($params->loadDocuments)
      {
        $category->documents = $this->getDocuments($category, $params);
      }
      if ($params->loadRootCategory)
      {
        $category->parentCategory = $this->loadCategory($category->parentCategoryId, $params);
      }
    }

    return $category;
  }
556406
public function addCategory($category)
    {
        if ( ! in_array($category, (array)$this->categories)) {
            $this->categories[] = $category;
        }

        return $this;
    }
812777
public void displayCategoryData(
        CmsSitemapCategoryData categoryData,
        final boolean openLocalCategories,
        CmsUUID openItemId) {

        final Set<CmsUUID> openIds = new HashSet<CmsUUID>();
        if (openLocalCategories) {
            if (openItemId != null) {
                openIds.add(openItemId);
            }
            for (Widget item : m_categoryTree) {
                if (item instanceof CmsTreeItem) {
                    ((CmsTreeItem)item).visit(new Function<CmsTreeItem, Boolean>() {

                        public Boolean apply(CmsTreeItem input) {

                            if (input.isOpen() && (input instanceof CmsCategoryTreeItem)) {
                                openIds.add(((CmsCategoryTreeItem)input).getStructureId());
                            }
                            return null;
                        }
                    });
                }
            }
        }

        m_categoryTree.clear();

        Multimap<Boolean, CmsCategoryTreeEntry> entries = categoryData.getEntriesIndexedByLocality();
        String localLabel = Messages.get().key(Messages.GUI_CATEGORIES_LOCAL_0);
        String nonlocalLabel = Messages.get().key(Messages.GUI_CATEGORIES_NONLOCAL_0);

        String localSubtitle = Messages.get().key(Messages.GUI_CATEGORIES_LOCAL_SUBTITLE_0);
        String nonlocalSubtitle = Messages.get().key(Messages.GUI_CATEGORIES_NONLOCAL_SUBTITLE_0);

        CmsListInfoBean localRootInfo = new CmsListInfoBean(localLabel, localSubtitle, null);
        localRootInfo.setResourceType("category");
        localRootInfo.setBigIconClasses(CmsCategoryBean.BIG_ICON_CLASSES);
        final CmsTreeItem localRoot = new CmsTreeItem(true, new CmsListItemWidget(localRootInfo));

        CmsListInfoBean nonlocalRootInfo = new CmsListInfoBean(nonlocalLabel, nonlocalSubtitle, null);
        nonlocalRootInfo.setResourceType("category");
        nonlocalRootInfo.setBigIconClasses(CmsCategoryBean.BIG_ICON_CLASSES);
        final CmsTreeItem nonlocalRoot = new CmsTreeItem(true, new CmsListItemWidget(nonlocalRootInfo));

        m_categoryTree.add(nonlocalRoot);
        m_categoryTree.add(localRoot);

        for (Boolean isLocal : Arrays.asList(Boolean.FALSE, Boolean.TRUE)) {
            for (CmsCategoryTreeEntry entry : entries.get(isLocal)) {
                CmsTreeItem treeItem = createCategoryTreeItem(entry);
                (isLocal.booleanValue() ? localRoot : nonlocalRoot).addChild(treeItem);
            }
        }

        for (CmsTreeItem root : Arrays.asList(localRoot, nonlocalRoot)) {
            final CmsTreeItem finalRoot = root;

            root.visit(new Function<CmsTreeItem, Boolean>() {

                @SuppressWarnings("synthetic-access")
                public Boolean apply(CmsTreeItem input) {

                    CmsUUID id = null;
                    if (input == localRoot) {
                        id = CmsUUID.getNullUUID();
                    } else if ((input instanceof CmsCategoryTreeItem) && (localRoot == finalRoot)) {
                        id = ((CmsCategoryTreeItem)input).getStructureId();

                    }

                    if ((id != null) && m_controller.isEditable()) {
                        final CmsSitemapHoverbar hoverbar = CmsSitemapHoverbar.installOn(
                            m_controller,
                            input,
                            id,
                            false,
                            !(id.isNullUUID()),
                            new I_CmsContextMenuItemProvider() {

                                public List<A_CmsSitemapMenuEntry> createContextMenu(CmsSitemapHoverbar hoverbar2) {

                                    List<A_CmsSitemapMenuEntry> result = Lists.newArrayList();

                                    result.add(new CmsChangeCategoryMenuEntry(hoverbar2));
                                    result.add(new CmsDeleteCategoryMenuEntry(hoverbar2));
                                    return result;
                                }
                            });
                        if (input == localRoot) {
                            hoverbar.setAlwaysVisible();
                        }
                        CmsPushButton newButton = new CmsPushButton();
                        newButton.setTitle(Messages.get().key(Messages.GUI_SITEMAP_CONTEXT_MENU_CREATE_CATEGORY_0));
                        newButton.setImageClass(I_CmsButton.ADD_SMALL);
                        newButton.setButtonStyle(ButtonStyle.FONT_ICON, null);
                        hoverbar.add(newButton);
                        newButton.addClickHandler(new ClickHandler() {

                            /**
                             * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
                             */
                            public void onClick(ClickEvent event) {

                                hoverbar.hide();
                                final CmsSitemapController controller = hoverbar.getController();
                                final CmsUUID hoverbarId = hoverbar.getId();
                                CmsCreateCategoryMenuEntry.askForNewCategoryInfo(
                                    hoverbarId,
                                    new AsyncCallback<CmsCategoryTitleAndName>() {

                                        public void onFailure(Throwable caught) {

                                            // do nothing
                                        }

                                        public void onSuccess(CmsCategoryTitleAndName result) {

                                            controller.createCategory(hoverbarId, result.getTitle(), result.getName());
                                        }
                                    });
                            }
                        });
                    }
                    if (((finalRoot == localRoot) && openLocalCategories && openIds.contains(id))
                        || (input == nonlocalRoot)
                        || (input == localRoot)) {
                        input.setOpen(true);
                    }
                    return null;
                }
            });
        }
    }
23834
private function InitCategoryArticles()
    {
        $tblArticle = Article::Schema()->Table();
        $sql = Access::SqlBuilder();
        $orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
        $this->articles = Article::Schema()->FetchByCategory(false, $this->category, $orderBy, null, $this->ArticleOffset(), $this->perPage);
        $this->articlesTotal = Article::Schema()->CountByCategory(false, $this->category);
    }
1121540
protected function LoadFromBasketPostProcessData($oBasket, &$aOrderData)
    {
        // ------------------------------------------------------------------------
        parent::LoadFromBasketPostProcessData($oBasket, $aOrderData);
        if (method_exists($oBasket, 'getUserSelectedNewsletterOptionInOrderStep') && $oBasket->getUserSelectedNewsletterOptionInOrderStep()) {
            $aOrderData['newsletter_signup'] = '1';
        } else {
            $aOrderData['newsletter_signup'] = '0';
        }
    }
1356584
public function compileCategories()
	{
		foreach ($this->site->getCategories() as $category) 
		{
			$template = $this->twig->loadTemplate( 'category.html.tpl' );
			$content = $template->render(array('site' => $this->site, 'category' => $category));
			$this->createFile($content, $category);
		}
	}
354070
protected function _getCategoryList()
    {
        if ($this->_oCatList == null) {
            $this->_oCatList = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
            $this->_oCatList->updateCategoryTree(false);
        }

        return $this->_oCatList;
    }
149553
public function updateCategory($path, $category)
    {
        $this->categories[$path] = array_merge($this->categories[$path], $category);
    }
868462
public function addCategoryToCrawlerQueue($category) {
        $catUrls = array();
        $origStore = Mage::app()->getStore();
        foreach (Mage::app()->getStores() as $storeId => $store) {
            Mage::app()->setCurrentStore($store);
            $catUrls[] = $category->getUrl();
        }
        Mage::app()->setCurrentStore($origStore);
        return $this->addUrlsToCrawlerQueue($catUrls);
    }
325336
public function loadCatMenues()
    {
        $this->_load(self::TYPE_CATEGORY_MENU);
        $aArray = [];

        if ($this->count()) {
            foreach ($this as $oContent) {
                // add into category tree
                if (!isset($aArray[$oContent->getCategoryId()])) {
                    $aArray[$oContent->getCategoryId()] = [];
                }

                $aArray[$oContent->oxcontents__oxcatid->value][] = $oContent;
            }
        }

        $this->_aArray = $aArray;
    }
1036283
protected function _loadArticles($category)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $numberOfCategoryArticles = (int) $config->getConfigParam('iNrofCatArticles');
        $numberOfCategoryArticles = $numberOfCategoryArticles ? $numberOfCategoryArticles : 1;

        // load only articles which we show on screen
        $articleList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $articleList->setSqlLimit($numberOfCategoryArticles * $this->_getRequestPageNr(), $numberOfCategoryArticles);
        $articleList->setCustomSorting($this->getSortingSql($this->getSortIdent()));

        if ($category->isPriceCategory()) {
            $priceFrom = $category->oxcategories__oxpricefrom->value;
            $priceTo = $category->oxcategories__oxpriceto->value;

            $this->_iAllArtCnt = $articleList->loadPriceArticles($priceFrom, $priceTo, $category);
        } else {
            $sessionFilter = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('session_attrfilter');

            $activeCategoryId = $category->getId();
            $this->_iAllArtCnt = $articleList->loadCategoryArticles($activeCategoryId, $sessionFilter);
        }

        $this->_iCntPages = ceil($this->_iAllArtCnt / $numberOfCategoryArticles);

        return $articleList;
    }
559057
public function load(ICategory $category)
    {
        $this->template->set('title', $category->getTitle());
        $this->template->set('meta_title', $category->metaTitle());
        $this->template->set('meta_keywords', $category->metaKeywords());
        $this->template->set('meta_description', $category->metaDescription());
    }
179807
public function loadNewestArticles()
    {
        if (($this->_aChannel = $this->_loadFromCache(self::RSS_NEWARTS))) {
            return;
        }
        $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $oArtList->loadNewestArticles(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount'));

        $oLang = Registry::getLang();
        $this->_loadData(
            self::RSS_NEWARTS,
            $this->getNewestArticlesTitle(),
            $oLang->translateString('NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()),
            $this->_getArticleItems($oArtList),
            $this->getNewestArticlesUrl()
        );
    }
633518
private function InitCategoryArticles()
    {
        $sql = Access::SqlBuilder();
        $tblArticle = Article::Schema()->Table();
        $orderBy = $sql->OrderList($sql->OrderDesc($tblArticle->Field('Created')));
        $where = $this->PublishedCondition()->
                And_($sql->Equals($tblArticle->Field('Category'), 
                        $sql->Value($this->category->GetID())));
        $this->articles = Article::Schema()->Fetch(false, $where, $orderBy);
        $this->articlesTotal = Article::Schema()->Count(false, $where);
    }
147133
public function &GetArticleList($sOrderBy = null, $aFilter = array())
    {
        $oCategoryArticles = $this->GetFromInternalCache('oArticleList');
        if (is_null($oCategoryArticles)) {
            $oCategoryArticles = &TdbShopArticleList::LoadCategoryArticleList($this->id, $sOrderBy, -1, $aFilter);
            $this->SetInternalCache('oArticleList', $oCategoryArticles);
        }

        return $oCategoryArticles;
    }