Loads and returns the article for that basket item

@param string $sItemKey the key that will be given to oxarticle setItemKey

@throws oxArticleException article exception

@return oxArticle
544233
public function getArticle($sItemKey)
    {
        if (!$this->oxuserbasketitems__oxartid->value) {
            //this exception may not be caught, anyhow this is a critical exception
            $oEx = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleException::class);
            $oEx->setMessage('EXCEPTION_ARTICLE_NOPRODUCTID');
            throw $oEx;
        }

        if ($this->_oArticle === null) {
            $this->_oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);

            // performance
            /* removed due to #4178
             if ( $this->_blParentBuyable ) {
                $this->_oArticle->setNoVariantLoading( true );
            }
            */

            if (!$this->_oArticle->load($this->oxuserbasketitems__oxartid->value)) {
                return false;
            }

            $aSelList = $this->getSelList();
            if (($aSelectlist = $this->_oArticle->getSelectLists()) && is_array($aSelList)) {
                foreach ($aSelList as $iKey => $iSel) {
                    if (isset($aSelectlist[$iKey][$iSel])) {
                        // cloning select list information
                        $aSelectlist[$iKey][$iSel] = clone $aSelectlist[$iKey][$iSel];
                        $aSelectlist[$iKey][$iSel]->selected = 1;
                    }
                }
                $this->_oArticle->setSelectlist($aSelectlist);
            }

            // generating item key
            $this->_oArticle->setItemKey($sItemKey);
        }

        return $this->_oArticle;
    }
1369832
public function getPreviousItem($currentArticleId, $pagerSpotName)
    {
        $result = $this->searchPrevious($currentArticleId, $this->requestToListUrlConverter->getListUrl());
        if (null === $result) {
            return null;
        }

        $item = $result['item'];
        $pageUrl = $result['pageUrl'];

        return $this->addPagerInfoToItem($item, $pageUrl);
    }
165781
public function getBasketHash($sAmazonOrderReferenceId, $oBasket)
    {
        $aBasket = array(
            'amazonOrderReferenceId' => $sAmazonOrderReferenceId,
            'totalSum' => $oBasket->getBruttoSum(),
            'contents' => array()
        );

        /** @var oxBasketItem $oBasketItem */
        foreach ($oBasket->getContents() as $oBasketItem) {
            $sId = $oBasketItem->getArticle()->getId();
            $aBasket['contents'][$sId] = $oBasketItem->getAmount();
        }

        return md5(json_encode($aBasket));
    }
32486
public function getNextItem($currentArticleId, $pagerSpotName)
    {
        $result = $this->searchNext($currentArticleId, $this->requestToListUrlConverter->getListUrl());

        if (null === $result) {
            return null;
        }
        $item = $result['item'];
        $pageUrl = $result['pageUrl'];

        return $this->addPagerInfoToItem($item, $pageUrl);
    }
1072289
protected function _loadFromDb($articleId)
    {
        $sSelect = $this->buildSelectString([$this->getViewName() . ".oxid" => $articleId]);

        return \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->getRow($sSelect);
    }
337333
public function setActionArticle()
    {
        $sArticleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxarticleid');
        $sActionId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $oDb->Execute(
            'delete from oxobject2action '
            . 'where oxactionid=' . $oDb->quote($sActionId)
            . ' and oxclass = "oxarticle"'
        );

        $oObject2Promotion = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
        $oObject2Promotion->init('oxobject2action');
        $oObject2Promotion->oxobject2action__oxactionid = new \OxidEsales\Eshop\Core\Field($sActionId);
        $oObject2Promotion->oxobject2action__oxobjectid = new \OxidEsales\Eshop\Core\Field($sArticleId);
        $oObject2Promotion->oxobject2action__oxclass = new \OxidEsales\Eshop\Core\Field("oxarticle");
        $oObject2Promotion->save();
    }
156272
protected function getCacheKey($itemkey)
    {
        $key = self::CACHE_PREFIX;

        // Add global identifier
        if ($this->config()->get('lock_bypage')) {
            $key .= '_' . md5($itemkey);
        }

        // Add user-specific identifier
        if ($this->config()->get('lock_byuserip') && Controller::has_curr()) {
            $ip = Controller::curr()->getRequest()->getIP();
            $key .= '_' . md5($ip);
        }

        return $key;
    }
89243
public function getArrayItem(string $key, string $subKey, $defaultValue = null)
    {
        $expectedArray = $this->get($key, []);

        if (!is_array($expectedArray)) {
            $type = gettype($expectedArray);
            throw new ConfigException("Trying to fetch array from config={$this->name()} under key={$key}, but got '{$type}' instead");
        }

        return array_key_exists($subKey, $expectedArray) ? $expectedArray[$subKey] : $defaultValue;
    }
920299
public function setItem($key, $item) {
		if (is_array($key)) {
			$key = $this->arrayHashFunction($key);
		}
		
		if (! isset($this->_data[$key])) {
			$this->_map[] = $key;
		}
		
		if (is_object($item)) {
			$modelClass = $this->getModel();
			if (! $item instanceof $modelClass) {
				throw new Exception('Model must be an instance of "' . $modelClass . '"');
			}
			
			$item->setCollection($this);
			
			$this->_data[$key]   = &$item->getDataLinked();
			$this->_models[$key] = $item;
		}
		elseif (is_array($item)) {
			$this->_data[$key] = $item;
		}
		else {
			throw new Exception('Unknown type of item: "' . gettype($item) . '"');
		}
		
		return $this;
	}
598055
protected function _prepareArticleTitle($oArticle)
    {
        // create title part for uri
        if (!($sTitle = $oArticle->oxarticles__oxtitle->value)) {
            // taking parent article title
            if (($sParentId = $oArticle->oxarticles__oxparentid->value)) {
                // looking in cache ..
                if (!isset(self::$_aTitleCache[$sParentId])) {
                    $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
                    $sQ = "select oxtitle from " . $oArticle->getViewName() . " where oxid = " . $oDb->quote($sParentId);
                    self::$_aTitleCache[$sParentId] = $oDb->getOne($sQ);
                }
                $sTitle = self::$_aTitleCache[$sParentId];
            }
        }

        // variant has varselect value
        if ($oArticle->oxarticles__oxvarselect->value) {
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxvarselect->value . ' ';
        } elseif (!$sTitle || ($oArticle->oxarticles__oxparentid->value)) {
            // in case nothing was found - looking for number
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxartnum->value;
        }

        return $this->_prepareTitle($sTitle, false, $oArticle->getLanguage()) . $this->_getUrlExtension();
    }
929606
public function getSubModule ($moduleKey)
		{
			if (isset($this->subModules[$moduleKey])) {
				return $this->subModules[$moduleKey];
			} else {
				throw new NonexistentSubModuleException('No submodule ' . $moduleKey);
			}
		}
259280
public function getCell($columnKey, $rowKey)
    {
        $column = $this->getColumn($columnKey);
        $row    = $this->getRow($rowKey);

        return $row[$column];
    }
1141050
public function getItemOperationAttribute(?string $operationName, string $key, $defaultValue = null, bool $resourceFallback = false)
    {
        return $this->findOperationAttribute($this->itemOperations, $operationName, $key, $defaultValue, $resourceFallback);
    }
1343541
protected function _getMainCategory($oArticle)
    {
        $oMainCat = null;

        // if variant parent id must be used
        $sArtId = $oArticle->getId();
        if (isset($oArticle->oxarticles__oxparentid->value) && $oArticle->oxarticles__oxparentid->value) {
            $sArtId = $oArticle->oxarticles__oxparentid->value;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        // add main category caching;
        $sQ = "select oxcatnid from " . getViewName("oxobject2category") . " where oxobjectid = " . $oDb->quote($sArtId) . " order by oxtime";
        $sIdent = md5($sQ);

        if (($sMainCatId = $this->_loadFromCache($sIdent, "oxarticle")) === false) {
            $sMainCatId = $oDb->getOne($sQ);
            // storing in cache
            $this->_saveInCache($sIdent, $sMainCatId, "oxarticle");
        }

        if ($sMainCatId) {
            $oMainCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
            if (!$oMainCat->load($sMainCatId)) {
                $oMainCat = null;
            }
        }

        return $oMainCat;
    }
988911
public function getString($nsKey, $itemKey)
    {
        $this->prepareCache($nsKey);
        if ($this->hasKey($nsKey, $itemKey)) {
            return $this->contents[$nsKey][$itemKey];
        }
    }
733553
public function getItem($key, $itemId)
    {
        $dataset = $this->getDataset($key);

        foreach ($dataset as $item) {
            if ($item["id"] === $itemId) {
                return $item;
            }
        }
        return null;
    }
468952
public function getItem($cache, $key)
    {
        $cache = self::encodeCache($cache);
        $key = self::encodeKey($key);
        $url = "projects/{$this->project_id}/caches/$cache/items/$key";

        $this->setJsonHeaders();
        try {
            $res = $this->apiCall(self::GET, $url);
        } catch (Http_Exception $e) {
            if ($e->getCode() == Http_Exception::NOT_FOUND) {
                return null;
            } else {
                throw $e;
            }
        }
        return self::json_decode($res);
    }