|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Repository; |
|
4
|
|
|
|
|
5
|
|
|
use ControleOnline\Entity\ProductGroup; |
|
6
|
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
|
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\OptimisticLockException; |
|
|
|
|
|
|
8
|
|
|
use Doctrine\ORM\ORMException; |
|
|
|
|
|
|
9
|
|
|
use Doctrine\Persistence\ManagerRegistry; |
|
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @extends ServiceEntityRepository<ProductGroup> |
|
13
|
|
|
* |
|
14
|
|
|
* @method ProductGroup|null find($id, $lockMode = null, $lockVersion = null) |
|
15
|
|
|
* @method ProductGroup|null findOneBy(array $criteria, array $orderBy = null) |
|
16
|
|
|
* @method ProductGroup[] findAll() |
|
17
|
|
|
* @method ProductGroup[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) |
|
18
|
|
|
*/ |
|
19
|
|
|
class ProductGroupRepository extends ServiceEntityRepository |
|
20
|
|
|
{ |
|
21
|
|
|
public function __construct(ManagerRegistry $registry) |
|
22
|
|
|
{ |
|
23
|
|
|
parent::__construct($registry, ProductGroup::class); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @throws ORMException |
|
28
|
|
|
* @throws OptimisticLockException |
|
29
|
|
|
*/ |
|
30
|
|
|
public function add(ProductGroup $entity, bool $flush = true): void |
|
31
|
|
|
{ |
|
32
|
|
|
$this->_em->persist($entity); |
|
33
|
|
|
if ($flush) { |
|
34
|
|
|
$this->_em->flush(); |
|
35
|
|
|
} |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @throws ORMException |
|
40
|
|
|
* @throws OptimisticLockException |
|
41
|
|
|
*/ |
|
42
|
|
|
public function remove(ProductGroup $entity, bool $flush = true): void |
|
43
|
|
|
{ |
|
44
|
|
|
$this->_em->remove($entity); |
|
45
|
|
|
if ($flush) { |
|
46
|
|
|
$this->_em->flush(); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
// /** |
|
51
|
|
|
// * @return ProductGroup[] Returns an array of ProductGroup objects |
|
52
|
|
|
// */ |
|
53
|
|
|
/* |
|
54
|
|
|
public function findByExampleField($value) |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->createQueryBuilder('p') |
|
57
|
|
|
->andWhere('p.exampleField = :val') |
|
58
|
|
|
->setParameter('val', $value) |
|
59
|
|
|
->orderBy('p.id', 'ASC') |
|
60
|
|
|
->setMaxResults(10) |
|
61
|
|
|
->getQuery() |
|
62
|
|
|
->getResult() |
|
63
|
|
|
; |
|
64
|
|
|
} |
|
65
|
|
|
*/ |
|
66
|
|
|
|
|
67
|
|
|
/* |
|
68
|
|
|
public function findOneBySomeField($value): ?ProductGroup |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->createQueryBuilder('p') |
|
71
|
|
|
->andWhere('p.exampleField = :val') |
|
72
|
|
|
->setParameter('val', $value) |
|
73
|
|
|
->getQuery() |
|
74
|
|
|
->getOneOrNullResult() |
|
75
|
|
|
; |
|
76
|
|
|
} |
|
77
|
|
|
*/ |
|
78
|
|
|
} |
|
79
|
|
|
|
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