Ejemplo n.º 1
0
 /**
  * @param int $calendarId
  * @param int $newCalendarId
  */
 private function migrateCalendar($calendarId, $newCalendarId)
 {
     $this->adapter->foreachCalendarObject($calendarId, function ($calObject) use($newCalendarId) {
         try {
             $this->backend->createCalendarObject($newCalendarId, $calObject['uri'], $calObject['calendardata']);
         } catch (\Exception $ex) {
             $eventId = $calObject['id'];
             $calendarId = $calObject['calendarId'];
             $msg = "One event could not be migrated. (id: {$eventId}, calendarid: {$calendarId})";
             $this->logger->logException($ex, ['app' => 'dav', 'message' => $msg]);
             if (!is_null($this->consoleOutput)) {
                 $this->consoleOutput->writeln($msg);
             }
         }
     });
 }
Ejemplo n.º 2
0
    private function createEvent($calendarId, $start = '20130912T130000Z', $end = '20130912T140000Z')
    {
        $calData = <<<EOD
BEGIN:VCALENDAR
VERSION:2.0
PRODID:ownCloud Calendar
BEGIN:VEVENT
CREATED;VALUE=DATE-TIME:20130910T125139Z
UID:47d15e3ec8
LAST-MODIFIED;VALUE=DATE-TIME:20130910T125139Z
DTSTAMP;VALUE=DATE-TIME:20130910T125139Z
SUMMARY:Test Event
DTSTART;VALUE=DATE-TIME:{$start}
DTEND;VALUE=DATE-TIME:{$end}
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR
EOD;
        $uri0 = $this->getUniqueID('event');
        $this->backend->createCalendarObject($calendarId, $uri0, $calData);
        return $uri0;
    }
Ejemplo n.º 3
0
 /**
  * @param int $calendarId
  * @param int $newCalendarId
  */
 private function migrateCalendar($calendarId, $newCalendarId)
 {
     $this->adapter->foreachCalendarObject($calendarId, function ($calObject) use($newCalendarId) {
         $this->backend->createCalendarObject($newCalendarId, $calObject['uri'], $calObject['calendardata']);
     });
 }