summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/caldav/caldavbackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/caldav/caldavbackend.php')
-rw-r--r--apps/dav/lib/caldav/caldavbackend.php26
1 files changed, 7 insertions, 19 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php
index 19bbc6cb93d..08a2a70c56d 100644
--- a/apps/dav/lib/caldav/caldavbackend.php
+++ b/apps/dav/lib/caldav/caldavbackend.php
@@ -169,19 +169,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return void
*/
function createCalendar($principalUri, $calendarUri, array $properties) {
- $fieldNames = [
- 'principaluri',
- 'uri',
- 'synctoken',
- 'transparent',
- 'components'
- ];
$values = [
'principaluri' => $principalUri,
'uri' => $calendarUri,
'synctoken' => 1,
'transparent' => 0,
- 'components' => 'VEVENT,VTODO'
+ 'components' => 'VEVENT,VTODO',
+ 'displayname' => $calendarUri
];
// Default value
@@ -199,22 +193,16 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
foreach($this->propertyMap as $xmlName=>$dbName) {
if (isset($properties[$xmlName])) {
-
$values[$dbName] = $properties[$xmlName];
- $fieldNames[] = $dbName;
}
}
$query = $this->db->getQueryBuilder();
- $query->insert('calendars')
- ->values([
- 'principaluri' => $query->createNamedParameter($values['principaluri']),
- 'uri' => $query->createNamedParameter($values['uri']),
- 'synctoken' => $query->createNamedParameter($values['synctoken']),
- 'transparent' => $query->createNamedParameter($values['transparent']),
- 'components' => $query->createNamedParameter($values['components']),
- ])
- ->execute();
+ $query->insert('calendars');
+ foreach($values as $column => $value) {
+ $query->setValue($column, $query->createNamedParameter($value));
+ }
+ $query->execute();
}
/**