| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function handleConfiguration(array &$times, Configuration $configuration) |
||
| 31 | { |
||
| 32 | $url = $configuration->getExternalIcsUrl(); |
||
| 33 | if (!GeneralUtility::isValidUrl($url)) { |
||
| 34 | HelperUtility::createFlashMessage( |
||
| 35 | 'Configuration with invalid ICS URL: ' . $url, |
||
| 36 | 'Index ICS URL', |
||
| 37 | FlashMessage::ERROR |
||
| 38 | ); |
||
| 39 | |||
| 40 | return; |
||
| 41 | } |
||
| 42 | |||
| 43 | $icsReaderService = GeneralUtility::makeInstance(IcsReaderService::class); |
||
| 44 | $externalTimes = $icsReaderService->getTimes($url); |
||
| 45 | foreach ($externalTimes as $time) { |
||
| 46 | $time['pid'] = $configuration->getPid(); |
||
| 47 | $time['state'] = $configuration->getState(); |
||
| 48 | $times[$this->calculateEntryKey($time)] = $time; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |
||
| 52 |