| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,48 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+declare(strict_types=1); |
|
| 4 |
+ |
|
| 5 |
+/* |
|
| 6 |
+ * This file is part of eSales Media SinglereisenBundle |
|
| 7 |
+ * |
|
| 8 |
+ * (c) Benjamin Roth |
|
| 9 |
+ * |
|
| 10 |
+ * @license proprietary |
|
| 11 |
+ */ |
|
| 12 |
+ |
|
| 13 |
+namespace vonRotenberg\WeinanlieferungBundle\Command; |
|
| 14 |
+ |
|
| 15 |
+use Contao\CoreBundle\Framework\ContaoFramework; |
|
| 16 |
+use Contao\System; |
|
| 17 |
+use Symfony\Component\Console\Command\Command; |
|
| 18 |
+use Symfony\Component\Console\Input\InputInterface; |
|
| 19 |
+use Symfony\Component\Console\Output\OutputInterface; |
|
| 20 |
+ |
|
| 21 |
+class SendBookingChangeNotificationCommand extends Command |
|
| 22 |
+{
|
|
| 23 |
+ public function __construct(ContaoFramework $framework) |
|
| 24 |
+ {
|
|
| 25 |
+ $this->framework = $framework; |
|
| 26 |
+ |
|
| 27 |
+ parent::__construct(); |
|
| 28 |
+ } |
|
| 29 |
+ |
|
| 30 |
+ protected function configure(): void |
|
| 31 |
+ {
|
|
| 32 |
+ $this |
|
| 33 |
+ ->setName('weinanlieferung:sendBookingNotifications')
|
|
| 34 |
+ ->setDescription('Sends notifications about newly added or modified bookings.')
|
|
| 35 |
+ ; |
|
| 36 |
+ } |
|
| 37 |
+ |
|
| 38 |
+ protected function execute(InputInterface $input, OutputInterface $output): int |
|
| 39 |
+ {
|
|
| 40 |
+ $this->framework->initialize(); |
|
| 41 |
+ |
|
| 42 |
+ $wa_service = System::getContainer()->get("vonrotenberg.cron.wa_booking_notifications");
|
|
| 43 |
+ |
|
| 44 |
+ $wa_service('cli');
|
|
| 45 |
+ |
|
| 46 |
+ return 0; |
|
| 47 |
+ } |
|
| 48 |
+} |