1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
batchmanager.php
См. документацию.
1
<?php
2
namespace
Bitrix\Catalog\Product\Store;
3
4
use Bitrix\Catalog\EO_StoreBatch;
5
use Bitrix\Catalog\EO_StoreBatch_Collection;
6
use Bitrix\Catalog\StoreBatchTable;
7
use Bitrix\Currency\CurrencyManager;
8
use Bitrix\Main\ArgumentException;
9
use Bitrix\Main\Loader;
10
use Bitrix\Main\ObjectPropertyException;
11
use Bitrix\Main\SystemException;
12
18
class
BatchManager
19
{
20
private
int
$productId;
21
22
public
function
__construct
(
int
$productId)
23
{
24
$this->productId = $productId;
25
}
26
30
public
function
getProductId
(): int
31
{
32
return
$this->productId;
33
}
34
44
public
function
getStoreCollection
(
array
$filter
=
null
):
EO_StoreBatch_Collection
45
{
46
$filter
[
'=ELEMENT_ID'
] = $this->
getProductId
();
47
48
return
StoreBatchTable::getList
([
49
'filter'
=>
$filter
,
50
'order'
=> [
'ID'
=>
'ASC'
],
51
])
52
->fetchCollection()
53
;
54
}
55
65
public
function
getAvailableStoreCollection
(
int
$storeId):
EO_StoreBatch_Collection
66
{
67
return
$this->
getStoreCollection
([
68
'>AVAILABLE_AMOUNT'
=> 0,
69
'=STORE_ID'
=> $storeId,
70
]);
71
}
72
82
public
function
calculateCostPrice
(
float
$quantity,
int
$storeId,
string
$currency
=
null
): float
83
{
84
if
(empty(
$currency
) && Loader::includeModule(
'currency'
))
85
{
86
$currency
= CurrencyManager::getBaseCurrency();
87
}
88
89
return
(
new
CostPriceCalculator
($this))->calculate($quantity, $storeId,
$currency
);
90
}
91
}
Bitrix\Catalog\EO_StoreBatch_Collection
Определения
orm.php:8000
Bitrix\Catalog\Product\Store\BatchManager
Определения
batchmanager.php:19
Bitrix\Catalog\Product\Store\BatchManager\getStoreCollection
getStoreCollection(array $filter=null)
Определения
batchmanager.php:44
Bitrix\Catalog\Product\Store\BatchManager\getProductId
getProductId()
Определения
batchmanager.php:30
Bitrix\Catalog\Product\Store\BatchManager\getAvailableStoreCollection
getAvailableStoreCollection(int $storeId)
Определения
batchmanager.php:65
Bitrix\Catalog\Product\Store\BatchManager\__construct
__construct(int $productId)
Определения
batchmanager.php:22
Bitrix\Catalog\Product\Store\BatchManager\calculateCostPrice
calculateCostPrice(float $quantity, int $storeId, string $currency=null)
Определения
batchmanager.php:82
Bitrix\Catalog\Product\Store\CostPriceCalculator
Определения
costpricecalculator.php:20
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$filter
$filter
Определения
iblock_catalog_list.php:54
$currency
$currency
Определения
template.php:266
bitrix
modules
catalog
lib
product
store
batchmanager.php
Создано системой
1.14.0