Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
storewithproductsinfo.php
1
<?php
2
3
namespace
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store
;
4
5
use
Bitrix\Catalog\Integration\Report\StoreStock\Entity\ProductInfo
;
6
7
class
StoreWithProductsInfo
extends
StoreInfo
8
{
9
protected
array
$productList
= [];
10
15
public
function
getProductList
(): array
16
{
17
return
$this->productList
;
18
}
19
25
public
function
addProduct
(
ProductInfo
...$product): void
26
{
27
array_push($this->productList, ...$product);
28
}
29
34
public
function
getCalculatedSumPrice
(): float
35
{
36
$sum = 0.0;
37
39
foreach
($this->
getProductList
() as $product)
40
{
41
$sum += $product->getPrice() * $product->getQuantity();
42
}
43
44
return
$sum;
45
}
46
}
Bitrix\Catalog\Integration\Report\StoreStock\Entity\ProductInfo
Definition
productinfo.php:12
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo
Definition
storeinfo.php:10
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreInfo\getCalculatedSumPrice
getCalculatedSumPrice()
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreWithProductsInfo
Definition
storewithproductsinfo.php:8
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreWithProductsInfo\addProduct
addProduct(ProductInfo ... $product)
Definition
storewithproductsinfo.php:25
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreWithProductsInfo\$productList
array $productList
Definition
storewithproductsinfo.php:9
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store\StoreWithProductsInfo\getProductList
getProductList()
Definition
storewithproductsinfo.php:15
Bitrix\Catalog\Integration\Report\StoreStock\Entity\Store
Definition
storeinfo.php:3
modules
catalog
lib
integration
report
storestock
entity
store
storewithproductsinfo.php
Создано системой
1.10.0