1 | <?php |
||
21 | class DefaultOfferEditingService implements OfferEditingServiceInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var CommandBusInterface |
||
25 | */ |
||
26 | protected $commandBus; |
||
27 | |||
28 | /** |
||
29 | * @var UuidGeneratorInterface |
||
30 | */ |
||
31 | protected $uuidGenerator; |
||
32 | |||
33 | /** |
||
34 | * @var DocumentRepositoryInterface |
||
35 | */ |
||
36 | protected $readRepository; |
||
37 | |||
38 | /** |
||
39 | * @var OfferCommandFactoryInterface |
||
40 | */ |
||
41 | protected $commandFactory; |
||
42 | |||
43 | /** |
||
44 | * @var LabelServiceInterface |
||
45 | */ |
||
46 | private $labelService; |
||
47 | |||
48 | /** |
||
49 | * @var \DateTimeImmutable|null |
||
50 | */ |
||
51 | protected $publicationDate; |
||
52 | |||
53 | /** |
||
54 | * @param CommandBusInterface $commandBus |
||
55 | * @param UuidGeneratorInterface $uuidGenerator |
||
56 | * @param DocumentRepositoryInterface $readRepository |
||
57 | * @param OfferCommandFactoryInterface $commandFactory |
||
58 | * @param LabelServiceInterface $labelService |
||
59 | */ |
||
60 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * @param \DateTimeImmutable $publicationDate |
||
77 | * @return static |
||
78 | */ |
||
79 | public function withFixedPublicationDateForNewOffers( |
||
86 | |||
87 | /** |
||
88 | * @param $id |
||
89 | * @param Label $label |
||
90 | * @return string |
||
91 | */ |
||
92 | public function addLabel($id, Label $label) |
||
108 | |||
109 | /** |
||
110 | * @param $id |
||
111 | * @param Label $label |
||
112 | * @return string |
||
113 | */ |
||
114 | public function removeLabel($id, Label $label) |
||
125 | |||
126 | /** |
||
127 | * @param $id |
||
128 | * @param Language $language |
||
129 | * @param StringLiteral $title |
||
130 | * @return string |
||
131 | */ |
||
132 | public function translateTitle($id, Language $language, StringLiteral $title) |
||
144 | |||
145 | /** |
||
146 | * @param $id |
||
147 | * @param Language $language |
||
148 | * @param Description $description |
||
149 | * @return string |
||
150 | */ |
||
151 | public function updateDescription($id, Language $language, Description $description) |
||
163 | |||
164 | /** |
||
165 | * @inheritdoc |
||
166 | */ |
||
167 | public function updateCalendar($id, Calendar $calendar) |
||
178 | |||
179 | /** |
||
180 | * @param string $id |
||
181 | * @param Image $image |
||
182 | * @return string |
||
183 | */ |
||
184 | public function addImage($id, Image $image) |
||
192 | |||
193 | /** |
||
194 | * @param string $id |
||
195 | * @param Image $image |
||
196 | * @param StringLiteral $description |
||
197 | * @param StringLiteral $copyrightHolder |
||
198 | * @return string |
||
199 | */ |
||
200 | public function updateImage( |
||
217 | |||
218 | /** |
||
219 | * @param $id |
||
220 | * Id of the offer to remove the image from. |
||
221 | * |
||
222 | * @param Image $image |
||
223 | * The image that should be removed. |
||
224 | * |
||
225 | * @return string |
||
226 | */ |
||
227 | public function removeImage($id, Image $image) |
||
235 | |||
236 | /** |
||
237 | * @param $id |
||
238 | * @param Image $image |
||
239 | * @return string |
||
240 | */ |
||
241 | public function selectMainImage($id, Image $image) |
||
249 | |||
250 | /** |
||
251 | * @param string $id |
||
252 | * @param AgeRange $ageRange |
||
253 | * @return string |
||
254 | */ |
||
255 | public function updateTypicalAgeRange($id, AgeRange $ageRange) |
||
263 | |||
264 | /** |
||
265 | * @param string $id |
||
266 | * @return string |
||
267 | */ |
||
268 | public function deleteTypicalAgeRange($id) |
||
277 | |||
278 | /** |
||
279 | * @param string $id |
||
280 | * @param string $organizerId |
||
281 | * @return string |
||
282 | */ |
||
283 | public function updateOrganizer($id, $organizerId) |
||
291 | |||
292 | /** |
||
293 | * @param string $id |
||
294 | * @param string $organizerId |
||
295 | * @return string |
||
296 | */ |
||
297 | public function deleteOrganizer($id, $organizerId) |
||
305 | |||
306 | /** |
||
307 | * @param string $id |
||
308 | * @param ContactPoint $contactPoint |
||
309 | * @return string |
||
310 | */ |
||
311 | public function updateContactPoint($id, ContactPoint $contactPoint) |
||
320 | |||
321 | /** |
||
322 | * @param string $id |
||
323 | * @param BookingInfo $bookingInfo |
||
324 | * @return string |
||
325 | */ |
||
326 | public function updateBookingInfo($id, BookingInfo $bookingInfo) |
||
334 | |||
335 | /** |
||
336 | * @param $id |
||
337 | * @param PriceInfo $priceInfo |
||
338 | */ |
||
339 | public function updatePriceInfo($id, PriceInfo $priceInfo) |
||
347 | |||
348 | /** |
||
349 | * @param string $id |
||
350 | * @return string |
||
351 | */ |
||
352 | public function delete($id) |
||
358 | |||
359 | /** |
||
360 | * @param string $id |
||
361 | */ |
||
362 | public function guardId($id) |
||
366 | } |
||
367 |