Exemplo n.º 1
0
 /**
  * @brief Returns the list of calendars for a specific user.
  * @param string $uid User ID
  * @param boolean $active Only return calendars with this $active state, default(=false) is don't care
  * @param boolean $bSubscribe  return calendars with this $issubscribe state, default(=true) is don't care
  * @return array
  */
 public static function allCalendars($uid, $active = false, $bSubscribe = true, $bShared = true)
 {
     $dbObject = \OC::$server->getDb();
     $calendarDB = new CalendarDAO($dbObject, $uid);
     $calendars = $calendarDB->all($active, $bSubscribe);
     if ($bShared === true) {
         $calendars = array_merge($calendars, \OCP\Share::getItemsSharedWith(App::SHARECALENDAR, ShareCalendar::FORMAT_CALENDAR));
     }
     \OCP\Util::emitHook('OCA\\CalendarPlus', 'getCalendars', array('calendar' => &$calendars));
     return $calendars;
 }
Exemplo n.º 2
0
 /**
  * @brief Returns the list of calendars for a specific user.
  * @param string $uid User ID
  * @param boolean $active Only return calendars with this $active state, default(=false) is don't care
  * @param boolean $bSubscribe  return calendars with this $issubscribe state, default(=true) is don't care
  * @return array
  */
 public function all($active = false, $bSubscribe = true)
 {
     $calendarDB = new CalendarDAO($this->db, $this->userId);
     $calendars = $calendarDB->all($active, $bSubscribe);
     $calendars = array_merge($calendars, $this->shareConnector->getItemsSharedWithCalendar());
     \OCP\Util::emitHook('OCA\\CalendarPlus', 'getCalendars', array('calendar' => &$calendars));
     return $calendars;
 }