$newValue) { switch ($property) { case '{DAV:}displayname' : $updates['displayname'] = $newValue; break; case '{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' : $updates['description'] = $newValue; break; default : // If any unsupported values were being updated, we must // let the entire request fail. return false; } } // No values are being updated? if (!$updates) { return false; } $query = 'UPDATE ' . CALDAV_SQL_DB . CALDAV_SQL_PREFIX . 'addressbooks SET ctag = ctag + 1 '; foreach ($updates as $key=> $value) { $query .= ', `' . dbesc($key) . '` = ' . dbesc($key) . ' '; } $query .= ' WHERE id = ' . IntVal($addressBookId); q($query); return true; } /** * @param int $addressbookId */ protected function increaseAddressbookCtag($addressbookId) { q("UPDATE %s%saddressbooks SET `ctag` = `ctag` + 1 WHERE `id` = '%d'", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($addressbookId)); self::$addressbookCache = array(); } }