Use table variable everywhere

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-03-12 11:05:05 +01:00 committed by Georg Ehrke
parent c914ae4c8d
commit 2e9f105786
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
1 changed files with 7 additions and 7 deletions

View File

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