Returns an array of products re-indexed by a class ID
@return array
183375
protected function getProductsSelectCompare()
    {
        $conditions = array(
            'product_id' => $this->getProductComparison());

        $options = array(
            'view' => $this->configTheme('compare_view', 'grid'),
            'buttons' => array('cart_add', 'wishlist_add', 'compare_remove')
        );

        $products = $this->getProducts($conditions, $options);
        return $this->reindexProductsCompare($products);
    }
1055714
public function getDiffReplacements()
    {
        $data = array();
        foreach ($this->getSafeAttributes() as $attribute) {
            if ($attribute->isReplaced()) {
                $data[$attribute->getName()] = $attribute->getValues();
            }
        }
        foreach ($this->tracker->getReplacements() as $name) {
            $data[$name] = $this->get($name)->getValues();
        }
        return $data;
    }
1090930
public function getCartSkus() {
    $items = $this->items();
    if (empty($items)) {
      return [];
    }

    $skus = [];
    foreach ($items as $item) {
      $skus[] = $item['sku'];
    }

    return $skus;
  }
981140
protected function getListProductClassField()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->product_class_field->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('class')) {
            return $this->product_class_field->getList(array('product_class_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('field')) {
            return $this->product_class_field->getList(array('field_id' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->product_class_field->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
479609
public function getSelectedRelatedProducts()
    {
        $products = [];
        foreach ($this->getPost()->getRelatedProducts() as $product) {
            $products[$product->getId()] = ['position' => 0];
        }

        return $products;
    }
1128726
protected function getByPriceTypeDESC() : array
    {
        $obPriceType = $this->getPriceTypeObject();
        if (empty($obPriceType)) {
            return $this->getByPriceDESC();
        }

        $arElementIDList = (array) Price::getByItemType(Offer::class)
            ->getByPriceType($obPriceType->id)
            ->orderBy('price', 'desc')
            ->lists('item_id');

        return $arElementIDList;
    }
1117612
protected function pullTagsFromProducts() : array
	{
		return $this->products->map(function ($item) {
			return explode(',', str_replace('"', '', $item->tags));
		})->flatten()->unique()->all();
	}
986631
public function getProduct()
    {
        if (!$this->hasData('product')) {
            $this->setData('product', $this->_coreRegistry->registry('product'));
        }
        return $this->getData('product');
    }
302845
protected function getIDListFromDB() : array
    {
        $arElementIDList = (array) Product::getByCategory($this->sValue)
            ->where('brand_id', '>', 0)
            ->lists('brand_id', 'id');

        $obCategory = Category::find($this->sValue);
        if (!empty($obCategory)) {
            $arAdditionalElementIDList = (array) $obCategory->product_link()
                ->where('brand_id', '>', 0)
                ->lists('brand_id', 'id');

            $arElementIDList = $arElementIDList + $arAdditionalElementIDList;
        }

        return $arElementIDList;
    }
1360621
public function index(): array {
        list($indexed, $commited) = $this->__index();

        $this->indexedRes  = array();
        $this->commitedRes = array();
        return $indexed;
    }
1306355
public function items()
    {
        $sessionId = $this->getSessionId();
        $userId = $this->auth->id();
        $items = $this->cartItem->getWithBuilder($this->instance, $this->getSessionId(), $userId)->get();

        return $items->filter(function ($item) {
            // Remove CartItem if product not exists
            if (empty($item->product)) {
                $item->delete();

                return false;
            }

            return true;
        });
    }
653724
public function getOrderedProducts(): Collection
    {
        return $this->products->matching(Criteria::create()->orderBy(['order' => Criteria::ASC]));
    }
939682
public function getItems()
    {
        if (count($this->items) > $this->itemsPerPage) {
            $items = [];
            $counter = 0;
            foreach ($this->items as $key => $value) {
                $items[$key] = $value;
                $counter++;
                if ($counter == $this->itemsPerPage) {
                    return $items;
                }
            }
        }

        return $this->items;
    }
448302
protected function getIDListFromDB() : array
    {
        //Get product ID list
        $arProductIDList = (array) Product::active()->lists('id');
        if (empty($arProductIDList)) {
            return [];
        }

        //Check active offers
        if (Settings::getValue('check_offer_active')) {
            //Get product list with active offers
            $arProductIDListWithOffers = (array) Offer::active()->groupBy('product_id')->lists('product_id');
            if (empty($arProductIDListWithOffers)) {
                return [];
            }

            $arProductIDList = array_intersect($arProductIDList, $arProductIDListWithOffers);
        }

        return $arProductIDList;
    }
21181
public function getMappedClasses()
    {
        if (null === $this->classes) {
            $this->classes = $this->getClassesFromYaml();
        }

        return array_keys($this->classes);
    }
529476
protected function getByPriceASC() : array
    {
        //Get product ID list (sort by offer price)
        //We can not use groupBy() in this place
        $arElementIDList = (array) DB::table('lovata_shopaholic_prices')
            ->select('lovata_shopaholic_offers.product_id')
            ->whereNull('lovata_shopaholic_prices.price_type_id')
            ->where('lovata_shopaholic_offers.active', true)
            ->where('lovata_shopaholic_prices.item_type', Offer::class)
            ->orderBy('lovata_shopaholic_prices.price', 'asc')
            ->join('lovata_shopaholic_offers', 'lovata_shopaholic_offers.id', '=', 'lovata_shopaholic_prices.item_id')
            ->lists('product_id');
        $arElementIDList = array_unique($arElementIDList);

        return $arElementIDList;
    }
1252843
protected function getIndexes()
    {
        $indexes = [];
        $rawIndexes = $this->getRawIndexes();

        foreach ($rawIndexes as $rawIndex) {
            $index = new Index($rawIndex->name);
            $index->addColumns(explode('|||', $rawIndex->columns));

            $indexes[] = $index;
        }

        return $indexes;
    }