]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/ApiBundle/Repository/ClientRepository.php
Merge pull request #3831 from wallabag/fix/api-bad-client-id
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Repository / ClientRepository.php
CommitLineData
3a2d4cf9
JB
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}