@param \TdbShopArticle[] $itemList

@return array
509476
private function mapItemsAsJson(array $itemList)
    {
        $response = array();
        foreach ($itemList as $item) {
            $response[$item->id] = array('id' => $item->id, 'name' => $item->GetNameSEO(), 'url' => $item->getLink());
        }

        return $response;
    }
525673
protected function getCustomSortingList() : array
    {
        $arEventResult = Event::fire('shopaholic.sorting.get.list', [$this->sValue]);
        if (empty($arEventResult)) {
            return [];
        }

        $arElementIDList = [];
        foreach ($arEventResult as $arEventProductIDList) {
            if (empty($arEventProductIDList) || !is_array($arEventProductIDList)) {
                continue;
            }

            $arElementIDList = $arEventProductIDList;
            break;
        }

        return $arElementIDList;
    }
253232
protected function getItemLines()
    {
        $result = array();

        $orderProducts = $this->getOrderModel()->getOrderProducts($this->invoiceSource->getId());
        foreach ($orderProducts as $line) {
            $result[] = $this->getItemLine($line);
        }

        return $result;
    }
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;
    }
230073
protected function getEnabledItems(array $list): array
	{
		$items = [];

		foreach ($list as $item => $enabled) {
			if ($enabled === true) {
				$items[] = $item;
			}
		}

		return $items;
	}
1155288
public function orderItemById($item_id, \WC_Abstract_Order $WC_Order = null)
    {
        if (!($item_id = (int) $item_id)) {
            return []; // Not possible.
        } elseif (!($WC_Order = $WC_Order ?: $this->orderByItemId($item_id))) {
            return []; // Not possible.
        }
        foreach ($WC_Order->get_items() as $_item_id => $_WC_Order_Item) {
            if ($_item_id === $item_id) {
                // WC 3.0+ uses `\WC_Order_Item`.
                // <https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Order.html>
                // <https://docs.woocommerce.com/wc-apidocs/class-WC_Order_Item.html>
                return $_WC_Order_Item; // `\WC_Order_Item|array`.
            }
        } // unset($_item_id, $_WC_Order_Item); // Housekeeping.

        return []; // Failure.
    }
347618
public function _getWishlistItems()
    {
        $wishlist = $this->_getWishlist();
        if ($wishlist && ! empty($wishlist->getItemCollection())) {
            return $wishlist->getItemCollection();
        } else {
            return [];
        }
    }
963931
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = [];
            if (($oVendor = $this->getActVendor()) && ($oVendor->getId() != 'root')) {
                list($aArticleList, $iAllArtCnt) = $this->_loadArticles($oVendor);
                if ($iAllArtCnt) {
                    $this->_aArticleList = $aArticleList;
                }
            }
        }

        return $this->_aArticleList;
    }
1077073
protected function formatDataList(DataList $dataList)
    {
        $formattedDataListMap = array();

        foreach ($dataList as $dataObject) {
            $formattedDataObjectMap = $this->formatDataObject($dataObject);
            if ($formattedDataObjectMap) {
                array_push($formattedDataListMap, $formattedDataObjectMap);
            }
        }

        return $formattedDataListMap;
    }
1293874
public function exportItems()
    {
        $columns = $this->getColumns();
        $rows = $this->getRows();
        $items = [];
        foreach ($rows as $row) {
            $item = [];
            foreach ($row['data'] as $index => $value) {
                $item[$columns[$index]['datasourceId']] = $value;
            }
            $items[] = $item;
        }

        return $items;
    }
613112
protected function getItemChildOptions($itemName)
    {
        $options = array();

        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        $item = $am->getAuthItem($itemName);
        if ($item instanceof CAuthItem) {
            $exclude = $am->getAncestors($itemName);
            $exclude[$itemName] = $item;
            $exclude = array_merge($exclude, $item->getChildren());
            $authItems = $am->getAuthItems();
            $validChildTypes = $this->getValidChildTypes();

            foreach ($authItems as $childName => $childItem) {
                if (in_array($childItem->type, $validChildTypes) && !isset($exclude[$childName])) {
                    $options[$this->capitalize(
                        $this->getItemTypeText($childItem->type, true)
                    )][$childName] = $childItem->description;
                }
            }
        }

        return $options;
    }
15567
public function getItems($offset, $itemCountPerPage)
    {
        if ($offset >= $this->count()) {
            return array();
        }

        $remainItemCount  = $this->count() - $offset;
        $currentItemCount = $remainItemCount > $itemCountPerPage ? $itemCountPerPage : $remainItemCount;

        return array_fill(0, $currentItemCount, null);
    }
1030223
public function generateItems(ItemInterface $templateItem, array $collections)
    {
        $result = [];
        $taxonomyCollection = [];
        $termCollection = [];
        $templateAttributes = $templateItem->getAttributes();
        $options = $this->buildAttributesResolver($templateItem);
        $taxonomyAttribute = $options['taxonomy_attribute'];
        $permalink = $options['permalink'];

        $templateAttributes['permalink'] = $options['pagination_permalink'];
        $templatePath = dirname($templateItem->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE));

        $items = (new ArrayWrapper($collections))->flatten();

        foreach ($items as $item) {
            $attributes = $item->getAttributes();

            if (isset($attributes[$taxonomyAttribute]) === false) {
                continue;
            }

            $terms = (array) $attributes[$taxonomyAttribute];

            foreach ($terms as $term) {
                if (empty(trim($term)) === true) {
                    continue;
                }

                $term = $this->normalizeTerm($term);
                $slugedTerm = (new StringWrapper($term))->slug();

                if (isset($taxonomyCollection[$slugedTerm]) === false) {
                    $taxonomyCollection[$slugedTerm] = [];
                }

                if (isset($termCollection[$slugedTerm]) === false) {
                    $termCollection[$slugedTerm] = [];
                }

                if (in_array($item, $taxonomyCollection[$slugedTerm]) === false) {
                    $taxonomyCollection[$slugedTerm][] = $item;
                }

                if (in_array($term, $termCollection[$slugedTerm]) === false) {
                    $termCollection[$slugedTerm][] = $term;
                }
            }
        }

        ksort($taxonomyCollection);

        foreach ($taxonomyCollection as $slugedTerm => $items) {
            $templateAttributes['provider'] = 'site.'.$slugedTerm;
            $templateAttributes['term'] = $termCollection[$slugedTerm][0];
            $templateItem->setAttributes($templateAttributes);
            $slugedTermPath = $this->getTermRelativePath($templatePath, $permalink, $slugedTerm);
            $templateItem->setPath($slugedTermPath, ItemInterface::SNAPSHOT_PATH_RELATIVE);

            $paginationGenerator = new PaginationGenerator();
            $itemsGenerated = $paginationGenerator->generateItems($templateItem, [$slugedTerm => $items]);

            $this->setTermsPermalink($items, $taxonomyAttribute, $termCollection[$slugedTerm], $slugedTermPath);

            $result = array_merge($result, $itemsGenerated);
        }

        return $result;
    }
1282499
public function &GetFieldPkgShopListfilterItemList()
    {
        $oList = &$this->GetFromInternalCache('FieldPkgShopListfilterItemList');
        if (is_null($oList)) {
            $aTrigger = array('class' => __CLASS__, 'method' => 'GetFieldPkgShopListfilterItemList', 'id' => $this->id);
            $aTrigger['activeFilter'] = TGlobal::instance()->GetUserData(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA);
            $bCaching = false;
            if (!is_array($aTrigger['activeFilter']) || 0 == count($aTrigger['activeFilter'])) {
                $bCaching = true;
            }
            $oList = null;
            $sKey = null;
            if ($bCaching) {
                /** @var CacheInterface $cache */
                $cache = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.cache');
                $sKey = $cache->GetKey($aTrigger);
                $oList = $cache->get($sKey);
            }
            if (null === $oList) {
                $oList = TdbPkgShopListfilterItemList::GetListForPkgShopListfilterId($this->id, $this->iLanguageId);
                $oList->bAllowItemCache = true;
                $i = 0;
                while ($oItem = $oList->Next()) {
                    ++$i;
                }
                $oList->GoToStart();
                if ($bCaching) {
                    $aCacheTrigger = array(array('table' => 'pkg_shop_listfilter_item', 'id' => null), array('table' => $this->table, 'id' => $this->id));
                    $cache->set($sKey, $oList, $aCacheTrigger);
                }
            }
            $this->SetInternalCache('FieldPkgShopListfilterItemList', $oList);
        }

        return $oList;
    }
1043341
public function getSubItems($itemType, $id, $subItem, array $queryString = []) {
      $options = [];
      if ($queryString) {
         $options['query'] = $queryString;
      }
      $response = $this->client->request('get', $itemType . '/' . $id . '/' . $subItem,
         $options);
      $contentRange = $response->getHeader('Content-Range');
      $acceptRange = $response->getHeader('Accept-Range');
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
         'contentRange' => ($contentRange) ? $contentRange[0] : null,
         'acceptRange' => ($acceptRange) ? $acceptRange[0] : null,
      ];
   }
842118
public static function GetItemInfo($itemname, $itemchunks)
  {
    $retval = "-";
    for ($i=0;$i<count($itemchunks);$i++)
    if (strcasecmp($itemchunks[$i], $itemname) == 0) $retval = $itemchunks[$i+1];
    return  $retval;
  }
687090
protected function _getArticleItems(\OxidEsales\Eshop\Application\Model\ArticleList $oList)
    {
        $myUtilsUrl = Registry::getUtilsUrl();
        $aItems = [];
        $oLang = Registry::getLang();
        $oStr = getStr();

        foreach ($oList as $oArticle) {
            $oItem = new stdClass();
            $oActCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
            $sPrice = '';

            // check if article is a variant
            if ($oArticle->isParentNotBuyable()) {
                $oPrice = $oArticle->getVarMinPrice();
            } else {
                $oPrice = $oArticle->getPrice();
            }

            if ($oPrice) {
                $sFrom = ($oArticle->isRangePrice()) ? Registry::getLang()->translateString('PRICE_FROM') . ' ' : '';
                $sPrice .= ' ' . $sFrom . $oLang->formatCurrency($oPrice->getBruttoPrice(), $oActCur) . ' ' . $oActCur->sign;
            }

            $oItem->title = strip_tags($oArticle->oxarticles__oxtitle->value . $sPrice);
            $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oArticle->getLink());
            $oItem->isGuidPermalink = true;
            // $oItem->description             = $oArticle->getLongDescription()->value; //oxarticles__oxshortdesc->value;
            //#4038: Smarty not parsed in RSS, although smarty parsing activated for longdescriptions
            if (Registry::getConfig()->getConfigParam('bl_perfParseLongDescinSmarty')) {
                $oItem->description = $oArticle->getLongDesc();
            } else {
                $oItem->description = $oArticle->getLongDescription()->value;
            }

            if (trim(str_replace('&nbsp;', '', (strip_tags($oItem->description)))) == '') {
                $oItem->description = $oArticle->oxarticles__oxshortdesc->value;
            }

            $oItem->description = trim($oItem->description);
            if ($sThumb = $oArticle->getThumbnailUrl()) {
                $oItem->description = "<img src='$sThumb' border=0 align='left' hspace=5>" . $oItem->description;
            }
            $oItem->description = $oStr->htmlspecialchars($oItem->description);

            if ($oArticle->oxarticles__oxtimestamp->value) {
                list($date, $time) = explode(' ', $oArticle->oxarticles__oxtimestamp->value);
                $date = explode('-', $date);
                $time = explode(':', $time);
                $oItem->date = date('D, d M Y H:i:s O', mktime($time[0], $time[1], $time[2], $date[1], $date[2], $date[0]));
            } else {
                $oItem->date = date('D, d M Y H:i:s O', time());
            }

            $aItems[] = $oItem;
        }

        return $aItems;
    }