Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
balancer.php
1<?php
3
7
13final 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 {
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}