diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-12 17:43:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 17:43:56 +0100 |
commit | fd8eeccb15e1219a2d18fc421e741c315737c55e (patch) | |
tree | 55b56592cf40ab4fcc605e45a95d13d79806eb91 /apps/dav | |
parent | 9e1ec0cf46055dbf08a139124d292eb38b8aebd2 (diff) | |
parent | bb352fb667e87ea0829f1da5f9e85c34bdefe9fa (diff) | |
download | nextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.tar.gz nextcloud-server-fd8eeccb15e1219a2d18fc421e741c315737c55e.zip |
Merge pull request #11942 from nextcloud/techdebt/noid/use-count-function
Use the defined func()->count() instead of manual counting
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index 60f163abcbf..187ba4ecdcf 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -213,7 +213,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription public function getCalendarsForUserCount($principalUri, $excludeBirthday = true) { $principalUri = $this->convertPrincipal($principalUri, true); $query = $this->db->getQueryBuilder(); - $query->select($query->createFunction('COUNT(*)')) + $query->select($query->func()->count('*')) ->from('calendars') ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); @@ -1045,7 +1045,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $extraData = $this->getDenormalizedData($calendarData); $q = $this->db->getQueryBuilder(); - $q->select($q->createFunction('COUNT(*)')) + $q->select($q->func()->count('*')) ->from('calendarobjects') ->where($q->expr()->eq('calendarid', $q->createNamedParameter($calendarId))) ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($extraData['uid']))) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index eb94885d177..699248f7b17 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -117,7 +117,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { public function getAddressBooksForUserCount($principalUri) { $principalUri = $this->convertPrincipal($principalUri, true); $query = $this->db->getQueryBuilder(); - $query->select($query->createFunction('COUNT(*)')) + $query->select($query->func()->count('*')) ->from('addressbooks') ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); |