backend = $backend; $this->l10n = $l10n; $this->config = $config; $this->logger = $logger; } /** * @param IManager $cm * @param string $userId */ public function setupCalendarProvider(IManager $cm, $userId) { $calendars = $this->backend->getCalendarsForUser("principals/users/$userId"); $this->register($cm, $calendars); } /** * @param IManager $cm * @param array $calendars */ private function register(IManager $cm, array $calendars) { foreach ($calendars as $calendarInfo) { $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $cm->registerCalendar(new CalendarImpl( $calendar, $calendarInfo, $this->backend )); } } }