Ejemplo n.º 1
0
 /**
  * Get the kolab_calendar instance for the given calendar ID
  *
  * @param string Calendar identifier (encoded imap folder name)
  * @return object kolab_calendar Object nor null if calendar doesn't exist
  */
 public function get_calendar($id)
 {
     // create calendar object if necesary
     if (!$this->calendars[$id] && in_array($id, array(self::INVITATIONS_CALENDAR_PENDING, self::INVITATIONS_CALENDAR_DECLINED))) {
         $this->calendars[$id] = new kolab_invitation_calendar($id, $this->cal);
     } else {
         if (!$this->calendars[$id] && $id !== self::BIRTHDAY_CALENDAR_ID) {
             $calendar = kolab_calendar::factory($id, $this->cal);
             if ($calendar->ready) {
                 $this->calendars[$calendar->id] = $calendar;
             }
         }
     }
     return $this->calendars[$id];
 }