1 | <?php |
||
31 | abstract class AbstractAction implements ActionInterface, EntityInterface |
||
32 | { |
||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $id; |
||
37 | |||
38 | /** |
||
39 | * @var TypeInterface |
||
40 | */ |
||
41 | protected $type; |
||
42 | |||
43 | /** |
||
44 | * @var TargetInterface |
||
45 | */ |
||
46 | protected $target; |
||
47 | |||
48 | /** |
||
49 | * @var QuantityInterface |
||
50 | */ |
||
51 | protected $quantity; |
||
52 | |||
53 | /** |
||
54 | * @var CustomerInterface |
||
55 | */ |
||
56 | protected $customer; |
||
57 | |||
58 | /** |
||
59 | * @var SaleInterface |
||
60 | */ |
||
61 | protected $sale; |
||
62 | |||
63 | /** |
||
64 | * @var DateTimeImmutable |
||
65 | */ |
||
66 | protected $time; |
||
67 | |||
68 | /** |
||
69 | * @var ActionInterface |
||
70 | */ |
||
71 | protected $parent; |
||
72 | |||
73 | /** |
||
74 | * @param TypeInterface $type |
||
75 | * @param TargetInterface $target |
||
76 | * @param QuantityInterface $quantity |
||
77 | * @param CustomerInterface $customer |
||
78 | * @param SaleInterface $sale |
||
79 | * @param DateTimeImmutable $time |
||
80 | * @param ActionInterface $parent |
||
81 | */ |
||
82 | 3 | public function __construct( |
|
101 | |||
102 | public function createSubaction(CustomerInterface $customer) |
||
106 | |||
107 | /** |
||
108 | * {@inheritdoc} |
||
109 | */ |
||
110 | public function getId() |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function getCustomer(): CustomerInterface |
||
119 | { |
||
120 | return $this->customer; |
||
121 | } |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | 3 | public function getTarget(): TargetInterface |
|
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | 3 | public function getType(): TypeInterface |
|
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | 3 | public function getQuantity(): QuantityInterface |
|
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | public function getSale() |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function getTime(): DateTimeImmutable |
||
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | public function getParent() |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function hasParent() |
||
178 | |||
179 | public function setId($id) |
||
189 | |||
190 | public function hasSale() |
||
194 | |||
195 | public function setSale(SaleInterface $sale) |
||
202 | |||
203 | /** |
||
204 | * {@inheritdoc} |
||
205 | */ |
||
206 | public function jsonSerialize() |
||
210 | |||
211 | /** |
||
212 | * @param PriceInterface $price |
||
213 | * @return ChargeInterface|Charge|null |
||
214 | */ |
||
215 | 3 | public function calculateCharge(PriceInterface $price): ?ChargeInterface |
|
233 | } |
||
234 |