修改文件注释

This commit is contained in:
乐风 2021-08-10 04:17:50 +08:00
parent 566954dfcf
commit 3b992432f7
2 changed files with 53 additions and 63 deletions

View File

@ -393,14 +393,14 @@ class CalDAV extends \Sabre\CalDAV\Backend\AbstractBackend
$extraData = $this->getDenormalizedData($calendarData);
$data = array(
'calendarid' => $calendarId,
'uri' => $objectUri,
'calendardata' => $calendarData,
'lastmodified' => time(),
'uri' => $objectUri,
'etag' => $extraData['etag'],
'size' => $extraData['size'],
'componenttype' => $extraData['componentType'],
'firstoccurence' => $extraData['firstOccurence'],
'lastoccurence' => $extraData['lastOccurence'],
'lastmodified' => time(),
);
CalendarObject::insert($data);
CalendarService::touchCalendar($calendarId);
@ -428,12 +428,12 @@ class CalDAV extends \Sabre\CalDAV\Backend\AbstractBackend
$extraData = $this->getDenormalizedData($calendarData);
$update = array(
'calendardata' => $calendarData,
'lastmodified' => time(),
'etag' => $extraData['etag'],
'size' => $extraData['size'],
'componenttype' => $extraData['componentType'],
'firstoccurence' => $extraData['firstOccurence'],
'lastoccurence' => $extraData['lastOccurence'],
'lastmodified' => time(),
);
CalendarObject::where('calendarid', $calendarId)->where('uri', $objectUri)->update($update);
CalendarService::touchCalendar($calendarId);

View File

@ -1,14 +1,5 @@
<?php namespace Gdoo\Calendar\Services;
/**
* Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
* Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
* Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
/**
* This class manages our calendar objects
*/
@ -183,9 +174,9 @@ class CalendarService
/**
* @brief Returns all objects of a calendar between $start and $end
* @param integer $id
* @param DateTime $start
* @param DateTime $end
* @param array $id
* @param int $start
* @param int $end
* @return array
*
* The objects are associative arrays. You'll find the original vObject
@ -296,19 +287,19 @@ class CalendarService
$extraData = self::getDenormalizedData($calendardata);
$uri = self::createURI().'.ics';
$data = array(
$data = [
'calendarid' => $id,
'uri' => $uri,
'calendardata' => $calendardata,
'lastmodified' => time(),
'attachment' => $attachment,
'rrule' => $extraData['rrule'],
'etag' => $extraData['etag'],
'size' => $extraData['size'],
'uri' => $uri,
'componenttype' => $extraData['componentType'],
'firstoccurence' => $extraData['firstOccurence'],
'lastoccurence' => $extraData['lastOccurence'],
);
'lastmodified' => time(),
];
$objectId = CalendarObject::insertGetId($data);
self::touchCalendar($id);
return $objectId;
@ -334,9 +325,8 @@ class CalendarService
}
$extraData = self::getDenormalizedData($calendardata);
$data = array(
$data = [
'calendardata' => $calendardata,
'lastmodified' => time(),
'attachment' => $attachment,
'rrule' => $extraData['rrule'],
'etag' => $extraData['etag'],
@ -344,7 +334,8 @@ class CalendarService
'componenttype' => $extraData['componentType'],
'firstoccurence' => $extraData['firstOccurence'],
'lastoccurence' => $extraData['lastOccurence'],
);
'lastmodified' => time(),
];
CalendarObject::where('id', $id)->update($data);
self::touchCalendar($event['calendarid']);
return true;
@ -449,14 +440,14 @@ class CalendarService
}
}
return array(
return [
'etag' => md5($calendarData),
'size' => strlen($calendarData),
'rrule' => $rrule,
'componentType' => $componentType,
'firstOccurence' => $firstOccurence,
'lastOccurence' => $lastOccurence,
);
];
}
/**
@ -1112,7 +1103,6 @@ class CalendarService
if ($allday) {
$return['start'] = $start_dt->format('Y-m-d');
//$end_dt->modify('-1 minute');
while ($start_dt >= $end_dt) {
$end_dt->modify('+1 day');
}