|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Repository; |
|
4
|
|
|
|
|
5
|
|
|
use ControleOnline\Entity\People; |
|
6
|
|
|
use ControleOnline\Entity\Status; |
|
|
|
|
|
|
7
|
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
|
|
|
|
|
|
8
|
|
|
use Doctrine\ORM\Query\ResultSetMapping; |
|
|
|
|
|
|
9
|
|
|
use Doctrine\Persistence\ManagerRegistry; |
|
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* @method People|null find($id, $lockMode = null, $lockVersion = null) |
|
14
|
|
|
* @method People|null findOneBy(array $criteria, array $orderBy = null) |
|
15
|
|
|
* @method People[] findAll() |
|
16
|
|
|
* @method People[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) |
|
17
|
|
|
*/ |
|
18
|
|
|
class PeopleRepository extends ServiceEntityRepository |
|
19
|
|
|
{ |
|
20
|
|
|
public function __construct(ManagerRegistry $registry) |
|
21
|
|
|
{ |
|
22
|
|
|
parent::__construct($registry, People::class); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public function getPeopleLink(People $people, $linkType, $maxResults = null) |
|
26
|
|
|
{ |
|
27
|
|
|
$queryBuilder = $this->getEntityManager()->createQueryBuilder(); |
|
28
|
|
|
$queryBuilder->select('pl') |
|
29
|
|
|
->from('ControleOnline\Entity\PeopleLink', 'pl') |
|
30
|
|
|
->where('pl.people = :peopleId') |
|
31
|
|
|
->andWhere('pl.link_type = :linkType') |
|
32
|
|
|
->setParameter('peopleId', $people->getId()) |
|
33
|
|
|
->setParameter('linkType', $linkType); |
|
34
|
|
|
|
|
35
|
|
|
if ($maxResults) { |
|
36
|
|
|
$queryBuilder->setMaxResults(1); |
|
37
|
|
|
return $queryBuilder->getQuery()->getOneOrNullResult(); |
|
38
|
|
|
} else { |
|
39
|
|
|
return $queryBuilder->getQuery()->getResult(); |
|
40
|
|
|
} |
|
41
|
|
|
} |
|
42
|
|
|
} |
|
43
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths