Returns array of product categories

@param \OxidEsales\Eshop\Application\Model\Article $oArticle Article object

@return array
541697
protected function _getCategoryList($oArticle)
    {
        $sMainCatId = false;
        if ($oMainCat = $oArticle->getCategory()) {
            $sMainCatId = $oMainCat->getId();
        }

        $aCatList = [];
        $iLang = $this->getEditLang();

        // adding categories
        $sView = getViewName('oxobject2category');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $sSqlForPriceCategories = $oArticle->getSqlForPriceCategories('oxid');
        $sQuotesArticleId = $oDb->quote($oArticle->getId());
        $sQ = "select oxobject2category.oxcatnid as oxid from {$sView} as oxobject2category " .
              "where oxobject2category.oxobjectid=" . $sQuotesArticleId . " union " . $sSqlForPriceCategories;

        $oRs = $oDb->select($sQ);
        if ($oRs != false && $oRs->count() > 0) {
            while (!$oRs->EOF) {
                $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
                if ($oCat->loadInLang($iLang, current($oRs->fields))) {
                    if ($sMainCatId == $oCat->getId()) {
                        $sSuffix = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('(main category)', $this->getEditLang());
                        $sTitleField = 'oxcategories__oxtitle';
                        $sTitle = $oCat->$sTitleField->getRawValue() . " " . $sSuffix;
                        $oCat->$sTitleField = new \OxidEsales\Eshop\Core\Field($sTitle, \OxidEsales\Eshop\Core\Field::T_RAW);
                    }
                    $aCatList[] = $oCat;
                }
                $oRs->fetchRow();
            }
        }

        return $aCatList;
    }
299693
public function getArticle($blReset = false)
    {
        if ($this->_oArticle !== null && !$blReset) {
            return $this->_oArticle;
        }
        $sProductId = $this->getEditObjectId();

        $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oProduct->load($sProductId);

        return $this->_oArticle = $oProduct;
    }
137564
public function &GetFieldPkgShopWishlistArticleList()
    {
        $oWishlistItems = $this->GetFromInternalCache('oPkgShopWishlistArticleList');
        if (is_null($oWishlistItems)) {
            $oWishlistItems = TdbPkgShopWishlistArticleList::GetListForPkgShopWishlistId($this->id, $this->iLanguageId);
            $oWishlistItems->bAllowItemCache = true;
            $this->SetInternalCache('oPkgShopWishlistArticleList', $oWishlistItems);
        }
        $oWishlistItems->GoToStart();

        return $oWishlistItems;
    }
1191877
public function getCategory()
    {
        $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
        $oCategory->setLanguage($this->getLanguage());

        // variant handling
        $sOXID = $this->getId();
        if (isset($this->oxarticles__oxparentid->value) && $this->oxarticles__oxparentid->value) {
            $sOXID = $this->oxarticles__oxparentid->value;
        }

        if ($sOXID) {
            // if the oxcategory instance of this article is not cached
            if (!isset($this->_aCategoryCache[$sOXID])) {
                startPRofile('getCategory');
                $oStr = getStr();
                $sWhere = $oCategory->getSqlActiveSnippet();
                $sSelect = $this->_generateSearchStr($sOXID);
                $sSelect .= ($oStr->strstr(
                    $sSelect,
                    'where'
                ) ? ' and ' : ' where ') . $sWhere . " order by oxobject2category.oxtime limit 1";

                // category not found ?
                if (!$oCategory->assignRecord($sSelect)) {
                    $sSelect = $this->_generateSearchStr($sOXID, true);
                    $sSelect .= ($oStr->strstr($sSelect, 'where') ? ' and ' : ' where ') . $sWhere . " limit 1";

                    // looking for price category
                    if (!$oCategory->assignRecord($sSelect)) {
                        $oCategory = null;
                    }
                }
                // add the category instance to cache
                $this->_aCategoryCache[$sOXID] = $oCategory;
                stopPRofile('getCategory');
            } else {
                // if the oxcategory instance is cached
                $oCategory = $this->_aCategoryCache[$sOXID];
            }
        }

        return $oCategory;
    }
779485
protected function CreateReview($aUserData, $oArticle)
    {
        $oModuleConfiguration = $this->GetModuleConfiguration();
        $oReviewItem = TdbShopArticleReview::GetNewInstance(); /*@var $oReviewItem TdbShopArticleReview*/
        $aUserData['shop_article_id'] = $oArticle->id;
        $oReviewItem->LoadFromRowProtected($aUserData);
        if ($oModuleConfiguration->fieldManageReviews) {
            $oReviewItem->sqlData['publish'] = '0';
        } else {
            $oReviewItem->sqlData['publish'] = '1';
        }
        $oReviewItem->AllowEditByAll(true);
        $oReviewItem->Save();

        return $oReviewItem;
    }
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()
        );
    }
284720
protected function GetReviewsForArticle($oActiveArticle)
    {
        $oModuleConfiguration = $this->GetModuleConfiguration();
        if ($oActiveArticle->IsVariant()) {
            $oActiveArticle = $oActiveArticle->GetFieldVariantParent();
        }
        $oActiveCategory = TdbShop::GetActiveCategory();

        $this->data['oActiveCategory'] = $oActiveCategory;
        $this->data['oActiveArticle'] = $oActiveArticle;
        if ($oModuleConfiguration->fieldAllowRateReview) {
            $oReviewList = TdbShopArticleReviewList::GetReviewsForArticleSortedByRate($oActiveArticle->id);
        } else {
            $oReviewList = TdbShopArticleReviewList::GetListForShopArticleId($oActiveArticle->id);
        }
        $oReviewList->AddFilterString("`shop_article_review`.`publish`='1'");

        return $oReviewList;
    }
444031
public function getArticleList()
    {
        if ($this->_oActRecommListArticles === null) {
            $this->_oActRecommListArticles = false;

            if (($oRecommList = $this->getActiveRecommList())) {
                $oItemList = $oRecommList->getArticles();

                if ($oItemList->count()) {
                    foreach ($oItemList as $key => $oItem) {
                        if (!$oItem->isVisible()) {
                            $oRecommList->removeArticle($oItem->getId());
                            $oItemList->offsetUnset($key);
                            continue;
                        }

                        $oItem->text = $oRecommList->getArtDescription($oItem->getId());
                    }
                    $this->_oActRecommListArticles = $oItemList;
                }
            }
        }

        return $this->_oActRecommListArticles;
    }
151360
protected function _getReviewList($article)
    {
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $query = "select oxreviews.* from oxreviews
                     where oxreviews.OXOBJECTID = " . $database->quote($article->oxarticles__oxid->value) . "
                     and oxreviews.oxtype = 'oxarticle'";

        $variantList = $article->getVariants();

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews') && count($variantList)) {
            // verifying rights
            foreach ($variantList as $variant) {
                $query .= "or oxreviews.oxobjectid = " . $database->quote($variant->oxarticles__oxid->value) . " ";
            }
        }

        //$sSelect .= "and oxreviews.oxtext".\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag($this->_iEditLang)." != ''";
        $query .= "and oxreviews.oxlang = '" . $this->_iEditLang . "'";
        $query .= "and oxreviews.oxtext != '' ";

        // all reviews
        $reviewList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
        $reviewList->init("oxreview");
        $reviewList->selectString($query);

        return $reviewList;
    }
1298205
protected function _getArticleBundles($oBasketItem)
    {
        $aBundles = [];

        if ($oBasketItem->isBundle()) {
            return $aBundles;
        }

        $oArticle = $oBasketItem->getArticle(true);
        if ($oArticle && $oArticle->oxarticles__oxbundleid->value) {
            $aBundles[$oArticle->oxarticles__oxbundleid->value] = 1;
        }

        return $aBundles;
    }
904737
public function getArticleFiles($blAddFromParent = false)
    {
        if ($this->_aArticleFiles === null) {
            $this->_aArticleFiles = false;

            $sQ = "SELECT * FROM `oxfiles` WHERE `oxartid` = '" . $this->getId() . "'";

            if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blVariantParentBuyable') && $blAddFromParent) {
                $sQ .= " OR `oxartId` = '" . $this->oxarticles__oxparentid->value . "'";
            }

            $oArticleFiles = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
            $oArticleFiles->init("oxfile");
            $oArticleFiles->selectString($sQ);
            $this->_aArticleFiles = $oArticleFiles;
        }

        return $this->_aArticleFiles;
    }
212878
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = [];
            if ($this->_getLoadActionsParam()) {
                // start list
                $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
                $oArtList->loadActionArticles('OXSTART');
                if ($oArtList->count()) {
                    $this->_aArticleList = $oArtList;
                }
            }
        }

        return $this->_aArticleList;
    }
1277856
public static function GetActiveItemVariant($oArticle)
    {
        $aVariantTypeSelection = TdbShopVariantDisplayHandler::GetActiveVariantTypeSelection(true);
        if (is_array($aVariantTypeSelection)) {
            $oSet = &$oArticle->GetFieldShopVariantSet();
            if (null === $oSet) {
                return $oArticle;
            }
            $oTypes = &$oSet->GetFieldShopVariantTypeList();
            if (count($aVariantTypeSelection) == $oTypes->Length()) {
                if (!$oArticle->IsVariant()) {
                    $oVariants = &$oArticle->GetFieldShopArticleVariantsList($aVariantTypeSelection);
                } else {
                    $oParentArticle = $oArticle->GetFieldVariantParent();
                    $oVariants = &$oParentArticle->GetFieldShopArticleVariantsList($aVariantTypeSelection);
                }

                if (1 == $oVariants->Length()) {
                    $oArticle = $oVariants->Current();
                }
            }
        } elseif (!$oArticle->IsVariant()) {
            $oVariants = &$oArticle->GetFieldShopArticleVariantsList();
            if (1 == $oVariants->Length()) {
                $oArticle = $oVariants->Current();
            }
        }

        return $oArticle;
    }
905893
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = [];
            if (($oManufacturerTree = $this->getManufacturerTree())) {
                $oManufacturer = $this->getActManufacturer();
                if ($oManufacturer && ($oManufacturer->getId() != 'root') && $oManufacturer->getIsVisible()) {
                    list($aArticleList, $iAllArtCnt) = $this->_loadArticles($oManufacturer);
                    if ($iAllArtCnt) {
                        $this->_aArticleList = $aArticleList;
                    }
                }
            }
        }

        return $this->_aArticleList;
    }
571857
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = false;
            if ($oActiveRecommList = $this->getActiveRecommList()) {
                // sets active page
                $iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
                $iActPage = ($iActPage < 0) ? 0 : $iActPage;

                // load only lists which we show on screen
                $iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
                $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;

                $this->_aArticleList = $oActiveRecommList->getArticles(
                    $iNrofCatArticles * $iActPage,
                    $iNrofCatArticles
                );

                if ($this->_aArticleList && $this->_aArticleList->count()) {
                    foreach ($this->_aArticleList as $oItem) {
                        $oItem->text = $oActiveRecommList->getArtDescription($oItem->getId());
                    }
                }
            }
        }

        return $this->_aArticleList;
    }
1125989
public function AllowDiscountForArticle(TdbShopArticle $oArticle)
    {
        $bMayBeUsed = true;
        if ($oArticle->fieldExcludeFromDiscounts) {
            $bMayBeUsed = false;
        }

        // check article restrictions
        if ($bMayBeUsed) {
            $aArticleRestrictions = $this->GetFieldShopArticleWithInverseEmptySelectionLogicIdList();
            if (null === $aArticleRestrictions || (count($aArticleRestrictions) > 0 && !in_array($oArticle->id, $aArticleRestrictions))) {
                $bMayBeUsed = false;
            }
        }

        // check category restrictions
        if ($bMayBeUsed) {
            $aCategoryRestrictions = $this->GetFieldShopCategoryWithInverseEmptySelectionLogicIdList();
            if (null === $aCategoryRestrictions || (count($aCategoryRestrictions) > 0 && !$oArticle->IsInCategory($aCategoryRestrictions))) {
                $bMayBeUsed = false;
            }
        }

        return $bMayBeUsed;
    }
1366372
public function getAccessoires()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // Performance
        if (!$myConfig->getConfigParam('bl_perfLoadAccessoires')) {
            return;
        }

        $oAcclist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $oAcclist->setSqlLimit(0, $myConfig->getConfigParam('iNrofCrossellArticles'));
        $oAcclist->loadArticleAccessoires($this->oxarticles__oxid->value);

        if ($oAcclist->count()) {
            return $oAcclist;
        }
    }