Merge branch '2014.11' into 2015.11
[tine20] / tine20 / Calendar / Frontend / WebDAV / Container.php
index 1d6b9d5..3dba01b 100644 (file)
@@ -467,4 +467,34 @@ class Calendar_Frontend_WebDAV_Container extends Tinebase_WebDav_Container_Abstr
     {
         return true;
     }
+
+    /**
+     * returns the changes happened since the provided syncToken which is the content sequence
+     *
+     * @param string $syncToken
+     * @return array
+     */
+    public function getChanges($syncToken)
+    {
+        $result = parent::getChanges($syncToken);
+
+        $newResult = array();
+        $backend = Calendar_Controller_Event::getInstance()->getBackend();
+
+        foreach ($result as $action => $value) {
+            if (!is_array($value)) {
+                $newResult[$action] = $value;
+                continue;
+            }
+
+            $uids = $backend->getUidOfBaseEvents(array_keys($value));
+
+            $newResult[$action] = array();
+            foreach($uids as $row) {
+                $newResult[$action][$row[0]] = $row[0] . $this->_suffix;
+            }
+        }
+
+        return $newResult;
+    }
 }