1 | <?php |
||
23 | class DefaultOfferEditingService implements OfferEditingServiceInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var CommandBusInterface |
||
27 | */ |
||
28 | protected $commandBus; |
||
29 | |||
30 | /** |
||
31 | * @var UuidGeneratorInterface |
||
32 | */ |
||
33 | protected $uuidGenerator; |
||
34 | |||
35 | /** |
||
36 | * @var DocumentRepositoryInterface |
||
37 | */ |
||
38 | protected $readRepository; |
||
39 | |||
40 | /** |
||
41 | * @var OfferCommandFactoryInterface |
||
42 | */ |
||
43 | protected $commandFactory; |
||
44 | |||
45 | /** |
||
46 | * @var LabelServiceInterface |
||
47 | */ |
||
48 | private $labelService; |
||
49 | |||
50 | /** |
||
51 | * @var \DateTimeImmutable|null |
||
52 | */ |
||
53 | protected $publicationDate; |
||
54 | |||
55 | /** |
||
56 | * @param CommandBusInterface $commandBus |
||
57 | * @param UuidGeneratorInterface $uuidGenerator |
||
58 | * @param DocumentRepositoryInterface $readRepository |
||
59 | * @param OfferCommandFactoryInterface $commandFactory |
||
60 | * @param LabelServiceInterface $labelService |
||
61 | */ |
||
62 | public function __construct( |
||
76 | |||
77 | /** |
||
78 | * @param \DateTimeImmutable $publicationDate |
||
79 | * @return static |
||
80 | */ |
||
81 | public function withFixedPublicationDateForNewOffers( |
||
88 | |||
89 | /** |
||
90 | * @param $id |
||
91 | * @param Label $label |
||
92 | * @return string |
||
93 | */ |
||
94 | public function addLabel($id, Label $label) |
||
110 | |||
111 | /** |
||
112 | * @param $id |
||
113 | * @param Label $label |
||
114 | * @return string |
||
115 | */ |
||
116 | public function removeLabel($id, Label $label) |
||
127 | |||
128 | /** |
||
129 | * @param $id |
||
130 | * @param Language $language |
||
131 | * @param StringLiteral $title |
||
132 | * @return string |
||
133 | */ |
||
134 | public function updateTitle($id, Language $language, StringLiteral $title) |
||
146 | |||
147 | /** |
||
148 | * @param $id |
||
149 | * @param Language $language |
||
150 | * @param Description $description |
||
151 | * @return string |
||
152 | */ |
||
153 | public function updateDescription($id, Language $language, Description $description) |
||
165 | |||
166 | /** |
||
167 | * @inheritdoc |
||
168 | */ |
||
169 | public function updateCalendar($id, Calendar $calendar) |
||
180 | |||
181 | /** |
||
182 | * @param string $id |
||
183 | * @param Image $image |
||
184 | * @return string |
||
185 | */ |
||
186 | public function addImage($id, Image $image) |
||
194 | |||
195 | /** |
||
196 | * @param string $id |
||
197 | * @param Image $image |
||
198 | * @param StringLiteral $description |
||
199 | * @param StringLiteral $copyrightHolder |
||
200 | * @return string |
||
201 | */ |
||
202 | public function updateImage( |
||
219 | |||
220 | /** |
||
221 | * @param $id |
||
222 | * Id of the offer to remove the image from. |
||
223 | * |
||
224 | * @param Image $image |
||
225 | * The image that should be removed. |
||
226 | * |
||
227 | * @return string |
||
228 | */ |
||
229 | public function removeImage($id, Image $image) |
||
237 | |||
238 | /** |
||
239 | * @param $id |
||
240 | * @param Image $image |
||
241 | * @return string |
||
242 | */ |
||
243 | public function selectMainImage($id, Image $image) |
||
251 | |||
252 | /** |
||
253 | * @param string $id |
||
254 | * @param AgeRange $ageRange |
||
255 | * @return string |
||
256 | */ |
||
257 | public function updateTypicalAgeRange($id, AgeRange $ageRange) |
||
265 | |||
266 | /** |
||
267 | * @param string $id |
||
268 | * @return string |
||
269 | */ |
||
270 | public function deleteTypicalAgeRange($id) |
||
279 | |||
280 | /** |
||
281 | * @param string $id |
||
282 | * @param string $organizerId |
||
283 | * @return string |
||
284 | */ |
||
285 | public function updateOrganizer($id, $organizerId) |
||
293 | |||
294 | /** |
||
295 | * @param string $id |
||
296 | * @param string $organizerId |
||
297 | * @return string |
||
298 | */ |
||
299 | public function deleteOrganizer($id, $organizerId) |
||
307 | |||
308 | /** |
||
309 | * @param string $id |
||
310 | * @param ContactPoint $contactPoint |
||
311 | * @return string |
||
312 | */ |
||
313 | public function updateContactPoint($id, ContactPoint $contactPoint) |
||
322 | |||
323 | /** |
||
324 | * @param string $id |
||
325 | * @param BookingInfo $bookingInfo |
||
326 | * @return string |
||
327 | */ |
||
328 | public function updateBookingInfo($id, BookingInfo $bookingInfo) |
||
336 | |||
337 | /** |
||
338 | * @param $id |
||
339 | * @param PriceInfo $priceInfo |
||
340 | */ |
||
341 | public function updatePriceInfo($id, PriceInfo $priceInfo) |
||
349 | |||
350 | /** |
||
351 | * @param string $id |
||
352 | * @return string |
||
353 | */ |
||
354 | public function delete($id) |
||
360 | |||
361 | /** |
||
362 | * @param string $id |
||
363 | * |
||
364 | * @throws EntityNotFoundException|DocumentGoneException |
||
365 | */ |
||
366 | public function guardId($id) |
||
376 | } |
||
377 |