calDavBackend = $calDavBackend; $this->l10n = $l10n; $this->config = $config; $this->logger = $logger; } public function getCalendars(string $principalUri, array $calendarUris = []): array { $calendarInfos = []; if (empty($calendarUris)) { $calendarInfos = $this->calDavBackend->getCalendarsForUser($principalUri); } else { foreach ($calendarUris as $calendarUri) { $calendarInfos[] = $this->calDavBackend->getCalendarByUri($principalUri, $calendarUri); } } $calendarInfos = array_filter($calendarInfos); $iCalendars = []; foreach ($calendarInfos as $calendarInfo) { $calendar = new Calendar($this->calDavBackend, $calendarInfo, $this->l10n, $this->config, $this->logger); $iCalendars[] = new CalendarImpl( $calendar, $calendarInfo, $this->calDavBackend, ); } return $iCalendars; } }