Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
balancer.php
1
<?php
2
namespace
Bitrix\Catalog\Product\Store\BatchBalancer
;
3
4
use
Bitrix\Catalog\Product\Store\CostPriceCalculator
;
5
use
Bitrix\Main\Result
;
6
use
Bitrix\Main\Type\DateTime
;
7
13
final
class
Balancer
14
{
15
private
int
$productId;
16
17
private
?
DateTime
$start =
null
;
18
19
public
function
__construct
(
int
$productId)
20
{
21
$this->productId = $productId;
22
}
23
24
public
function
getProductId
(): int
25
{
26
return
$this->productId;
27
}
28
29
public
function
setStartDate
(
DateTime
$start): self
30
{
31
$this->start = $start;
32
33
return
$this;
34
}
35
36
public
function
getStartDate
(): ?
DateTime
37
{
38
return
$this->start;
39
}
40
41
public
function
fill
():
Result
42
{
43
if
(
CostPriceCalculator::getMethod
() ===
CostPriceCalculator::METHOD_FIFO
)
44
{
45
$method =
new
Method\Fifo
($this);
46
}
47
else
48
{
49
$method =
new
Method\Average
($this);
50
}
51
52
return
$method->fill();
53
}
54
}
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer
Definition
balancer.php:14
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer\getStartDate
getStartDate()
Definition
balancer.php:36
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer\setStartDate
setStartDate(DateTime $start)
Definition
balancer.php:29
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer\fill
fill()
Definition
balancer.php:41
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer\getProductId
getProductId()
Definition
balancer.php:24
Bitrix\Catalog\Product\Store\BatchBalancer\Balancer\__construct
__construct(int $productId)
Definition
balancer.php:19
Bitrix\Catalog\Product\Store\BatchBalancer\Method\Average
Definition
average.php:18
Bitrix\Catalog\Product\Store\BatchBalancer\Method\Fifo
Definition
fifo.php:17
Bitrix\Catalog\Product\Store\CostPriceCalculator
Definition
costpricecalculator.php:19
Bitrix\Catalog\Product\Store\CostPriceCalculator\METHOD_FIFO
const METHOD_FIFO
Definition
costpricecalculator.php:20
Bitrix\Catalog\Product\Store\CostPriceCalculator\getMethod
static getMethod()
Definition
costpricecalculator.php:47
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Catalog\Product\Store\BatchBalancer
Definition
balancer.php:2
modules
catalog
lib
product
store
batchbalancer
balancer.php
Создано системой
1.10.0