diff options
author | lizyn <zhiylin@outlook.com> | 2020-02-24 10:04:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 10:04:13 +0800 |
commit | b19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch) | |
tree | d0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /src/Wallabag/ApiBundle/Repository | |
parent | 4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff) | |
parent | 04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff) | |
download | wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip |
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'src/Wallabag/ApiBundle/Repository')
-rw-r--r-- | src/Wallabag/ApiBundle/Repository/ClientRepository.php | 19 |
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 | |||
3 | namespace Wallabag\ApiBundle\Repository; | ||
4 | |||
5 | use Doctrine\ORM\EntityRepository; | ||
6 | |||
7 | class 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 | } | ||