Return the products included in this sale.

@return array an array of Products
13734
public function getSaleProductList()
    {
        $saleProducts = SaleProductQuery::create()->filterBySaleId($this->getId())->groupByProductId()->find();

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

        return $products;
    }
1275792
public function getCompras()
    {
        $detalle = [];
        foreach ($this->detalles as $d) {
            // armar iva no recuperable
            $iva_no_recuperable_codigo = [];
            $iva_no_recuperable_monto = [];
            foreach ((array)$d['IVANoRec'] as $inr) {
                $iva_no_recuperable_codigo[] = $inr['CodIVANoRec'];
                $iva_no_recuperable_monto[] = $inr['MntIVANoRec'];
            }
            // armar impuestos adicionales
            $impuesto_adicional_codigo = [];
            $impuesto_adicional_tasa = [];
            $impuesto_adicional_monto = [];
            foreach ((array)$d['OtrosImp'] as $ia) {
                $impuesto_adicional_codigo[] = $ia['CodImp'];
                $impuesto_adicional_tasa[] = $ia['TasaImp'];
                $impuesto_adicional_monto[] = $ia['MntImp'];
            }
            // armar detalle
            $detalle[] = [
                (int)$d['TpoDoc'],
                (int)$d['NroDoc'],
                $d['RUTDoc'],
                (int)$d['TasaImp'],
                $d['RznSoc'],
                $d['TpoImp']!==false ? $d['TpoImp'] : 1,
                $d['FchDoc'],
                $d['Anulado']!==false ? $d['Anulado'] : null,
                $d['MntExe']!==false ? $d['MntExe'] : null,
                $d['MntNeto']!==false ? $d['MntNeto'] : null,
                (int)$d['MntIVA'],
                $iva_no_recuperable_codigo ? implode(',', $iva_no_recuperable_codigo) : null,
                $iva_no_recuperable_monto ? implode(',', $iva_no_recuperable_monto) : null,
                $d['IVAUsoComun']!==false ? $d['IVAUsoComun'] : null,
                $impuesto_adicional_codigo ? implode(',', $impuesto_adicional_codigo) : null,
                $impuesto_adicional_tasa ? implode(',', $impuesto_adicional_tasa) : null,
                $impuesto_adicional_monto ? implode(',', $impuesto_adicional_monto) : null,
                $d['MntSinCred']!==false ? $d['MntSinCred'] : null,
                $d['MntActivoFijo']!==false ? $d['MntActivoFijo'] : null,
                $d['MntIVAActivoFijo']!==false ? $d['MntIVAActivoFijo'] : null,
                $d['IVANoRetenido']!==false ? $d['IVANoRetenido'] : null,
                $d['TabPuros']!==false ? $d['TabPuros'] : null,
                $d['TabCigarrillos']!==false ? $d['TabCigarrillos'] : null,
                $d['TabElaborado']!==false ? $d['TabElaborado'] : null,
                $d['ImpVehiculo']!==false ? $d['ImpVehiculo'] : null,
                $d['CdgSIISucur']!==false ? $d['CdgSIISucur'] : null,
                $d['NumInt']!==false ? $d['NumInt'] : null,
                $d['Emisor']!==false ? $d['Emisor'] : null,
                $d['MntTotal']!==false ? $d['MntTotal'] : null,
                (isset($d['FctProp']) and $d['FctProp']!==false) ? $d['FctProp'] : null,
            ];
        }
        return $detalle;
    }
542183
private function getItems()
    {
        $items = [];

        $layer = $this->layerResolver->get();
        $filterList = $this->getFilterList();

        foreach ($filterList->getFilters($layer) as $filter) {
            if ($filter->getRequestVar() == $this->getFilterName()) {
                foreach ($filter->getItems() as $item) {
                    $item->setBaseUrl($this->_redirect->getRedirectUrl());
                    $items[] = $item->toArray(['url', 'count', 'is_selected', 'label']);
                }
            }
        }

        return $items;
    }
362267
public function toArray()
    {
        return array(
            'title'    => $this->title,
            'code'     => $this->code,
            'amount'   => $this->amount,
            'price'    => $this->price,
            'vat'      => $this->vat,
            'discount' => $this->discount,
            'type'     => $this->type,
        );
    }
772303
protected function getByPriceTypeASC() : array
    {
        $obPriceType = $this->getPriceTypeObject();
        if (empty($obPriceType)) {
            return $this->getByPriceASC();
        }

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

        return $arElementIDList;
    }
244423
public function toArray()
	{
		$price = $this->_price;
		$locale = $this->_locale;

		return array(
			'order.base.id' => $this->getId(),
			'order.base.siteid' => $this->getSiteId(),
			'order.base.sitecode' => $this->getSiteCode(),
			'order.base.languageid' => $locale->getLanguageId(),
			'order.base.comment' => $this->getComment(),
			'order.base.customerid' => $this->getCustomerId(),
			'order.base.price' => $price->getValue(),
			'order.base.costs' => $price->getCosts(),
			'order.base.rebate' => $price->getRebate(),
			'order.base.currencyid' => $price->getCurrencyId(),
			'order.base.status' => $this->getStatus(),
			'order.base.mtime' => $this->getTimeModified(),
			'order.base.ctime' => $this->getTimeCreated(),
			'order.base.editor' => $this->getEditor(),
		);
	}
735222
public function getExcluded(): array
    {
        $arr = [];
        foreach ($this->columns as $name => $column) {
            if ($column->isExcluded()) {
                $arr[] = $name;
            }
        }

        return $arr;
    }
427821
public function getItems(): array
    {
        $available = [];
        $assigned = [];

        foreach (array_keys($this->manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        foreach ($this->manager->getAssignments($this->userId) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }
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;
    }
986631
public function getProduct()
    {
        if (!$this->hasData('product')) {
            $this->setData('product', $this->_coreRegistry->registry('product'));
        }
        return $this->getData('product');
    }
860001
public function getList()
    {
        $result = &gplcart_static('product.compare.list');

        if (isset($result)) {
            return (array) $result;
        }

        $this->hook->attach('product.compare.list.before', $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $cookie = $this->request->cookie('product_compare', '', 'string');
        $result = array_filter(array_map('trim', explode('|', urldecode($cookie))), 'ctype_digit');
        $this->hook->attach('product.compare.list.after', $result, $this);
        return $result;
    }
810572
public function toArray()
	{
		$list = parent::toArray();

		$list['product.stock.productid'] = $this->getProductId();
		$list['product.stock.warehouseid'] = $this->getWarehouseId();
		$list['product.stock.stocklevel'] = $this->getStocklevel();
		$list['product.stock.dateback'] = $this->getDateBack();

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

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

        return $result;
    }
577074
public function getBasketProducts()
    {
        $this->loadProducts();
        return array_map(
            function($item) {
                $item['params'] = Json::decode($item['params']);
                return $item;
            },
            $this->basketProducts
        );
    }
1018674
public function getProductCategoryIds()
    {

        // initialize the array with the product's category IDs
        $categoryIds = array();

        // query whether or not category IDs are available for the actual product entity
        if (isset($this->productCategoryIds[$lastEntityId = $this->getLastEntityId()])) {
            $categoryIds = $this->productCategoryIds[$lastEntityId];
        }

        // return the array with the product's category IDs
        return $categoryIds;
    }
1180428
public function toArray()
    {
        return [
            'name'                  => $this->name,
            'item_type'             => $this->item_type,
            'quantity'              => $this->quantity,
            'unit_price'            => CurrencyUtils::amountToExponent($this->unit_price, $this->currency),
            'tax_rate'              => CurrencyUtils::amountToExponent($this->tax_rate, $this->currency),
            'total_discount_amount' => CurrencyUtils::amountToExponent($this->total_discount_amount, $this->currency),
            'total_amount'          => CurrencyUtils::amountToExponent($this->getTotalAmount(), $this->currency),
            'total_tax_amount'      => CurrencyUtils::amountToExponent($this->getTotalTaxAmount(), $this->currency),
            'reference'             => $this->reference,
            'image_url'             => $this->image_url,
            'product_url'           => $this->product_url,
            'quantity_unit'         => $this->quantity_unit,
            'product_identifiers'   => $this->getProductIdentifiersParamsStructure(),
            'merchant_data'         => $this->getMerchantDataParamsStructure()
        ];
    }