1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
4
|
|
|
|
5
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
6
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
9
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
13
|
|
|
use DateTime; |
14
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
|
|
15
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
16
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class}) |
20
|
|
|
* @ORM\Entity (repositoryClass="ControleOnline\Repository\ContractModelRepository") |
21
|
|
|
*/ |
22
|
|
|
#[ApiResource( |
23
|
|
|
operations: [ |
24
|
|
|
new Get(security: 'is_granted(\'ROLE_CLIENT\')'), |
25
|
|
|
new Put(), |
26
|
|
|
new Post(), |
27
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')') |
28
|
|
|
], |
29
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
30
|
|
|
normalizationContext: ['groups' => ['contract_model_read']], |
31
|
|
|
denormalizationContext: ['groups' => ['contract_model_write']] |
32
|
|
|
)] |
33
|
|
|
class ContractModel |
34
|
|
|
{ |
35
|
|
|
/** |
36
|
|
|
* @ORM\Column(type="integer", nullable=false) |
37
|
|
|
* @ORM\Id |
38
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
39
|
|
|
* @Groups({ "contract_read"}) |
40
|
|
|
*/ |
41
|
|
|
private $id; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var \ControleOnline\Entity\Category |
|
|
|
|
45
|
|
|
* |
46
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Category") |
47
|
|
|
* @ORM\JoinColumns({ |
48
|
|
|
* @ORM\JoinColumn(name="category_id", referencedColumnName="id") |
49
|
|
|
* }) |
50
|
|
|
* @Groups({"contract_read"}) |
51
|
|
|
*/ |
52
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['category' => 'exact'])] |
53
|
|
|
|
54
|
|
|
private $category; |
55
|
|
|
/** |
56
|
|
|
* @var \ControleOnline\Entity\People |
|
|
|
|
57
|
|
|
* |
58
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People") |
59
|
|
|
* @ORM\JoinColumns({ |
60
|
|
|
* @ORM\JoinColumn(name="people_id", referencedColumnName="id") |
61
|
|
|
* }) |
62
|
|
|
* @Groups({"contract_read"}) |
63
|
|
|
*/ |
64
|
|
|
private $people; |
65
|
|
|
/** |
66
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
67
|
|
|
* @ORM\JoinColumns({ |
68
|
|
|
* @ORM\JoinColumn(referencedColumnName="id", nullable=false) |
69
|
|
|
* }) |
70
|
|
|
* @Groups({"contract_read"}) |
71
|
|
|
*/ |
72
|
|
|
private $file; |
73
|
|
|
|
74
|
|
|
public function __construct() {} |
75
|
|
|
public function getId(): int |
76
|
|
|
{ |
77
|
|
|
return $this->id; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Get }) |
82
|
|
|
*/ |
83
|
|
|
public function getFile() |
84
|
|
|
{ |
85
|
|
|
return $this->file; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Set }) |
90
|
|
|
*/ |
91
|
|
|
public function setFile($file): self |
92
|
|
|
{ |
93
|
|
|
$this->file = $file; |
94
|
|
|
|
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Get the value of people |
100
|
|
|
*/ |
101
|
|
|
public function getPeople(): \ControleOnline\Entity\People |
102
|
|
|
{ |
103
|
|
|
return $this->people; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Set the value of people |
108
|
|
|
*/ |
109
|
|
|
public function setPeople(\ControleOnline\Entity\People $people): self |
110
|
|
|
{ |
111
|
|
|
$this->people = $people; |
112
|
|
|
|
113
|
|
|
return $this; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Get the value of category |
118
|
|
|
*/ |
119
|
|
|
public function getCategory() |
120
|
|
|
{ |
121
|
|
|
return $this->category; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Set the value of category |
126
|
|
|
*/ |
127
|
|
|
public function setCategory($category): self |
128
|
|
|
{ |
129
|
|
|
$this->category = $category; |
130
|
|
|
|
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
} |
134
|
|
|
|
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