1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Repository; |
4
|
|
|
|
5
|
|
|
use ControleOnline\Entity\People; |
6
|
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
|
|
|
|
7
|
|
|
use Doctrine\Persistence\ManagerRegistry; |
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @method People|null find($id, $lockMode = null, $lockVersion = null) |
12
|
|
|
* @method People|null findOneBy(array $criteria, array $orderBy = null) |
13
|
|
|
* @method People[] findAll() |
14
|
|
|
* @method People[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) |
15
|
|
|
*/ |
16
|
|
|
class PeopleRepository extends ServiceEntityRepository |
17
|
|
|
{ |
18
|
|
|
public function __construct(ManagerRegistry $registry) |
19
|
|
|
{ |
20
|
|
|
parent::__construct($registry, People::class); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function getPeopleLinks(People $people, $linkType, $maxResults = null) |
24
|
|
|
{ |
25
|
|
|
$queryBuilder = $this->getEntityManager()->createQueryBuilder(); |
26
|
|
|
$queryBuilder->select('pl') |
27
|
|
|
->from('ControleOnline\Entity\PeopleLink', 'pl') |
28
|
|
|
->where('pl.people = :people') |
29
|
|
|
->andWhere('pl.link_type = :linkType') |
30
|
|
|
->setParameter('people', $people->getId()) |
31
|
|
|
->setParameter('linkType', $linkType); |
32
|
|
|
|
33
|
|
|
if ($maxResults) { |
34
|
|
|
$queryBuilder->setMaxResults($maxResults); |
35
|
|
|
return $queryBuilder->getQuery()->getOneOrNullResult(); |
36
|
|
|
} else { |
37
|
|
|
return $queryBuilder->getQuery()->getResult(); |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
public function getCompanyPeopleLinks(People $company, People $people, $linkType = null, $maxResults = null) |
43
|
|
|
{ |
44
|
|
|
$queryBuilder = $this->getEntityManager()->createQueryBuilder(); |
45
|
|
|
$queryBuilder->select('pl') |
46
|
|
|
->from('ControleOnline\Entity\PeopleLink', 'pl') |
47
|
|
|
->where('pl.people = :people') |
48
|
|
|
->andWhere('pl.company = :company') |
49
|
|
|
->setParameter('company', $company->getId()) |
50
|
|
|
->setParameter('people', $people->getId()); |
51
|
|
|
|
52
|
|
|
if ($linkType) |
53
|
|
|
$queryBuilder->setParameter('linkType', $linkType)->andWhere('pl.link_type = :linkType'); |
54
|
|
|
|
55
|
|
|
if ($maxResults) { |
56
|
|
|
$queryBuilder->setMaxResults($maxResults); |
57
|
|
|
return $queryBuilder->getQuery()->getOneOrNullResult(); |
58
|
|
|
} else { |
59
|
|
|
return $queryBuilder->getQuery()->getResult(); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|
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