]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use table variable everywhere
authorJoas Schilling <coding@schilljs.com>
Thu, 12 Mar 2020 10:05:05 +0000 (11:05 +0100)
committerGeorg Ehrke <developer@georgehrke.com>
Wed, 15 Apr 2020 13:49:12 +0000 (15:49 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/CardDAV/CardDavBackend.php

index 71b7e846f3d3b7966a72fb8ce673fb8e6adca435..7abfd64ed708b74e192fb1530272eacc32cb7edf 100644 (file)
@@ -449,7 +449,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
         */
        public function deleteAddressBook($addressBookId) {
                $query = $this->db->getQueryBuilder();
-               $query->delete('cards')
+               $query->delete($this->dbCardsTable)
                        ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
                        ->setParameter('addressbookid', $addressBookId)
                        ->execute();
@@ -493,7 +493,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
        public function getCards($addressBookId) {
                $query = $this->db->getQueryBuilder();
                $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
-                       ->from('cards')
+                       ->from($this->dbCardsTable)
                        ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
 
                $cards = [];
@@ -524,7 +524,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
        public function getCard($addressBookId, $cardUri) {
                $query = $this->db->getQueryBuilder();
                $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
-                       ->from('cards')
+                       ->from($this->dbCardsTable)
                        ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
                        ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
                        ->setMaxResults(1);
@@ -562,7 +562,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 
                $query = $this->db->getQueryBuilder();
                $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
-                       ->from('cards')
+                       ->from($this->dbCardsTable)
                        ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
                        ->andWhere($query->expr()->in('uri', $query->createParameter('uri')));
 
@@ -611,7 +611,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 
                $q = $this->db->getQueryBuilder();
                $q->select('uid')
-                       ->from('cards')
+                       ->from($this->dbCardsTable)
                        ->where($q->expr()->eq('addressbookid', $q->createNamedParameter($addressBookId)))
                        ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($uid)))
                        ->setMaxResults(1);
@@ -676,7 +676,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
                $uid = $this->getUID($cardData);
                $etag = md5($cardData);
                $query = $this->db->getQueryBuilder();
-               $query->update('cards')
+               $query->update($this->dbCardsTable)
                        ->set('carddata', $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB))
                        ->set('lastmodified', $query->createNamedParameter(time()))
                        ->set('size', $query->createNamedParameter(strlen($cardData)))
@@ -712,7 +712,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
                        $cardId = null;
                }
                $query = $this->db->getQueryBuilder();
-               $ret = $query->delete('cards')
+               $ret = $query->delete($this->dbCardsTable)
                        ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
                        ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
                        ->execute();