throw new \Sabre\DAV\Exception\BadRequest('VCard object with uid already exists in this addressbook collection.');
@ -825,7 +825,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
// Current synctoken
$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
$stmt->execute([$addressBookId]);
$stmt->execute([$addressBookId]);
$currentToken = $stmt->fetchColumn(0);
if (is_null($currentToken)) {
@ -834,14 +834,14 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$result = [
'syncToken' => $currentToken,
'added' => [],
'modified' => [],
'deleted' => [],
'added' => [],
'modified' => [],
'deleted' => [],
];
if ($syncToken) {
$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
if ($limit>0) {
if ($limit>0) {
$query .= " LIMIT " . (int)$limit;
}
@ -909,7 +909,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @param bool $modified
* @return string
*/
private function readBlob($cardData, &$modified=false) {
private function readBlob($cardData, &$modified=false) {
if (is_resource($cardData)) {
$cardData = stream_get_contents($cardData);
}
@ -957,9 +957,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @param string $pattern which should match within the $searchProperties
* @param array $searchProperties defines the properties within the query pattern should match
* @param array $options = array() to define the search behavior
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* - 'limit' - Set a numeric limit for the search results
* - 'offset' - Set the offset for the limited search results
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* - 'limit' - Set a numeric limit for the search results
* - 'offset' - Set the offset for the limited search results
* @return array an array of contacts which are arrays of key-value-pairs
*/
public function search($addressBookId, $pattern, $searchProperties, $options = []) {
@ -1013,7 +1013,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$matches = $result->fetchAll();
$result->closeCursor();
$matches = array_map(function ($match) {
return (int)$match['cardid'];
return (int)$match['cardid'];
}, $matches);
$query = $this->db->getQueryBuilder();
@ -1064,8 +1064,8 @@ class CardDavBackend implements BackendInterface, SyncSupport {