[Pkg-owncloud-commits] [php-sabredav] 09/42: When returning calendar objects, the id and calendarid are no longer needed.

David Prévot taffit at moszumanska.debian.org
Wed Oct 29 20:52:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 54740370f2b9f6ddd7d3d1c535c759b7d5a67fb3
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Oct 5 22:59:43 2014 +0100

    When returning calendar objects, the id and calendarid are no longer needed.
---
 lib/CalDAV/Backend/BackendInterface.php   | 2 --
 lib/CalDAV/Backend/PDO.php                | 2 --
 lib/CalDAV/CalendarObject.php             | 5 +----
 tests/Sabre/CalDAV/CalendarObjectTest.php | 2 +-
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/lib/CalDAV/Backend/BackendInterface.php b/lib/CalDAV/Backend/BackendInterface.php
index 064972f..a374d8a 100644
--- a/lib/CalDAV/Backend/BackendInterface.php
+++ b/lib/CalDAV/Backend/BackendInterface.php
@@ -81,7 +81,6 @@ interface BackendInterface {
      * Returns all calendar objects within a calendar.
      *
      * Every item contains an array with the following keys:
-     *   * id - unique identifier which will be used for subsequent updates
      *   * calendardata - The iCalendar-compatible calendar data
      *   * uri - a unique key which will be used to construct the uri. This can
      *     be any arbitrary string, but making sure it ends with '.ics' is a
@@ -90,7 +89,6 @@ interface BackendInterface {
      *   * lastmodified - a timestamp of the last modification time
      *   * etag - An arbitrary string, surrounded by double-quotes. (e.g.:
      *   '"abcdef"')
-     *   * calendarid - The calendarid as it was passed to this function.
      *   * size - The size of the calendar objects, in bytes.
      *   * component - optional, a string containing the type of object, such
      *     as 'vevent' or 'vtodo'. If specified, this will be used to populate
diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index 71e7fc3..f177cd4 100644
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -329,7 +329,6 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
      * Returns all calendar objects within a calendar.
      *
      * Every item contains an array with the following keys:
-     *   * id - unique identifier which will be used for subsequent updates
      *   * calendardata - The iCalendar-compatible calendar data
      *   * uri - a unique key which will be used to construct the uri. This can
      *     be any arbitrary string, but making sure it ends with '.ics' is a
@@ -338,7 +337,6 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
      *   * lastmodified - a timestamp of the last modification time
      *   * etag - An arbitrary string, surrounded by double-quotes. (e.g.:
      *   '  "abcdef"')
-     *   * calendarid - The calendarid as it was passed to this function.
      *   * size - The size of the calendar objects, in bytes.
      *   * component - optional, a string containing the type of object, such
      *     as 'vevent' or 'vtodo'. If specified, this will be used to populate
diff --git a/lib/CalDAV/CalendarObject.php b/lib/CalDAV/CalendarObject.php
index b9e525e..3dee00a 100644
--- a/lib/CalDAV/CalendarObject.php
+++ b/lib/CalDAV/CalendarObject.php
@@ -54,9 +54,6 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
 
         $this->caldavBackend = $caldavBackend;
 
-        if (!isset($objectData['calendarid'])) {
-            throw new \InvalidArgumentException('The objectData argument must contain a \'calendarid\' property');
-        }
         if (!isset($objectData['uri'])) {
             throw new \InvalidArgumentException('The objectData argument must contain an \'uri\' property');
         }
@@ -87,7 +84,7 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\
         // Pre-populating the 'calendardata' is optional, if we don't have it
         // already we fetch it from the backend.
         if (!isset($this->objectData['calendardata'])) {
-            $this->objectData = $this->caldavBackend->getCalendarObject($this->objectData['calendarid'], $this->objectData['uri']);
+            $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri']);
         }
         return $this->objectData['calendardata'];
 
diff --git a/tests/Sabre/CalDAV/CalendarObjectTest.php b/tests/Sabre/CalDAV/CalendarObjectTest.php
index 4793957..9fc1eee 100644
--- a/tests/Sabre/CalDAV/CalendarObjectTest.php
+++ b/tests/Sabre/CalDAV/CalendarObjectTest.php
@@ -314,7 +314,7 @@ END:VCALENDAR";
                 ),
             )
         ));
-        $obj = new CalendarObject($backend, array(), array('calendarid' => 1, 'uri' => 'foo'));
+        $obj = new CalendarObject($backend, array('id' => 1), array('uri' => 'foo'));
 
         $this->assertEquals('foo', $obj->get());
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list