aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Repository/ClientRepository.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2019-01-15 09:41:18 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-01-15 09:41:18 +0100
commit5419a8368ebb4b4d57f481b842f1fcc576c9149d (patch)
treecd970bb8f3ec5e6487fc1e3bd2de1f89455d3d90 /src/Wallabag/ApiBundle/Repository/ClientRepository.php
parent5c331bf0f9ef679aaf91ef29b13120272fcccbf5 (diff)
parentf6b9e883c01196d5aec249f6e8e02e07d0da4089 (diff)
downloadwallabag-5419a8368ebb4b4d57f481b842f1fcc576c9149d.tar.gz
wallabag-5419a8368ebb4b4d57f481b842f1fcc576c9149d.tar.zst
wallabag-5419a8368ebb4b4d57f481b842f1fcc576c9149d.zip
Merge remote-tracking branch 'origin/master' into 2.4
Diffstat (limited to 'src/Wallabag/ApiBundle/Repository/ClientRepository.php')
-rw-r--r--src/Wallabag/ApiBundle/Repository/ClientRepository.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Repository/ClientRepository.php b/src/Wallabag/ApiBundle/Repository/ClientRepository.php
new file mode 100644
index 00000000..fc14262e
--- /dev/null
+++ b/src/Wallabag/ApiBundle/Repository/ClientRepository.php
@@ -0,0 +1,19 @@
1<?php
2
3namespace Wallabag\ApiBundle\Repository;
4
5use Doctrine\ORM\EntityRepository;
6
7class ClientRepository extends EntityRepository
8{
9 public function findOneBy(array $criteria, array $orderBy = null)
10 {
11 if (!empty($criteria['id'])) {
12 // cast client id to be an integer to avoid postgres error:
13 // "invalid input syntax for integer"
14 $criteria['id'] = (int) $criteria['id'];
15 }
16
17 return parent::findOneBy($criteria, $orderBy);
18 }
19}