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\Metadata\Delete; |
|
|
|
|
10
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
13
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
14
|
|
|
use DateTime; |
15
|
|
|
use Doctrine\Common\Collections\Collection; |
|
|
|
|
16
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
17
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class}) |
21
|
|
|
* @ORM\Entity (repositoryClass="ControleOnline\Repository\ContractModelRepository") |
22
|
|
|
*/ |
23
|
|
|
#[ApiResource( |
24
|
|
|
operations: [ |
25
|
|
|
new Get( |
26
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')', |
27
|
|
|
normalizationContext: ['groups' => ['contract_model_detail_read']] |
28
|
|
|
), |
29
|
|
|
new Put( |
30
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')' |
31
|
|
|
), |
32
|
|
|
new Post( |
33
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')' |
34
|
|
|
), |
35
|
|
|
new Delete( |
36
|
|
|
security: 'is_granted(\'ROLE_CLIENT\')' |
37
|
|
|
), |
38
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')') |
39
|
|
|
], |
40
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
41
|
|
|
normalizationContext: ['groups' => ['contract_model_read']], |
42
|
|
|
denormalizationContext: ['groups' => ['contract_model_write']] |
43
|
|
|
)] |
44
|
|
|
class ContractModel |
45
|
|
|
{ |
46
|
|
|
/** |
47
|
|
|
* @ORM\Column(type="integer", nullable=false) |
48
|
|
|
* @ORM\Id |
49
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
50
|
|
|
* @Groups({ "contract_read","contract_model_read","contract_model_detail_read"}) |
51
|
|
|
*/ |
52
|
|
|
private $id; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var \ControleOnline\Entity\Category |
|
|
|
|
56
|
|
|
* |
57
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Category") |
58
|
|
|
* @ORM\JoinColumns({ |
59
|
|
|
* @ORM\JoinColumn(name="category_id", referencedColumnName="id") |
60
|
|
|
* }) |
61
|
|
|
* @Groups({"contract_read","contract_model_read","contract_model_write","contract_model_detail_read"}) |
62
|
|
|
*/ |
63
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['category' => 'exact'])] |
64
|
|
|
|
65
|
|
|
private $category; |
66
|
|
|
/** |
67
|
|
|
* @var \ControleOnline\Entity\People |
|
|
|
|
68
|
|
|
* |
69
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People") |
70
|
|
|
* @ORM\JoinColumns({ |
71
|
|
|
* @ORM\JoinColumn(name="people_id", referencedColumnName="id") |
72
|
|
|
* }) |
73
|
|
|
* @Groups({"contract_read","contract_model_read","contract_model_write","contract_model_detail_read"}) |
74
|
|
|
*/ |
75
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['people' => 'exact'])] |
76
|
|
|
|
77
|
|
|
private $people; |
78
|
|
|
|
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var \ControleOnline\Entity\People |
82
|
|
|
* |
83
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People") |
84
|
|
|
* @ORM\JoinColumns({ |
85
|
|
|
* @ORM\JoinColumn(name="signer_id", referencedColumnName="id") |
86
|
|
|
* }) |
87
|
|
|
* @Groups({"contract_read","contract_model_read","contract_model_write","contract_model_detail_read"}) |
88
|
|
|
*/ |
89
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['signer' => 'exact'])] |
90
|
|
|
|
91
|
|
|
private $signer; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @ORM\Column(name="content", type="string") |
95
|
|
|
* @Groups({"contract_model_detail_read","contract_model_write","contract_model_detail_read"}) |
96
|
|
|
*/ |
97
|
|
|
private $content; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @ORM\Column(name="context", type="string") |
101
|
|
|
* @Groups({"contract_read","contract_model_read","contract_model_detail_read","contract_model_write","contract_model_detail_read"}) |
102
|
|
|
*/ |
103
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['context' => 'exact'])] |
104
|
|
|
private $context; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @ORM\Column(name="model", type="string") |
108
|
|
|
* @Groups({"contract_read","contract_model_read","contract_model_detail_read","contract_model_write","contract_model_detail_read"}) |
109
|
|
|
*/ |
110
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['model' => 'partial'])] |
111
|
|
|
private $model; |
112
|
|
|
|
113
|
|
|
|
114
|
|
|
public function getId(): int |
115
|
|
|
{ |
116
|
|
|
return $this->id; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
|
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Get the value of people |
123
|
|
|
*/ |
124
|
|
|
public function getPeople(): \ControleOnline\Entity\People |
125
|
|
|
{ |
126
|
|
|
return $this->people; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Set the value of people |
131
|
|
|
*/ |
132
|
|
|
public function setPeople(\ControleOnline\Entity\People $people): self |
133
|
|
|
{ |
134
|
|
|
$this->people = $people; |
135
|
|
|
|
136
|
|
|
return $this; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Get the value of category |
141
|
|
|
*/ |
142
|
|
|
public function getCategory() |
143
|
|
|
{ |
144
|
|
|
return $this->category; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* Set the value of category |
149
|
|
|
*/ |
150
|
|
|
public function setCategory($category): self |
151
|
|
|
{ |
152
|
|
|
$this->category = $category; |
153
|
|
|
|
154
|
|
|
return $this; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* Get the value of content |
159
|
|
|
*/ |
160
|
|
|
public function getContent() |
161
|
|
|
{ |
162
|
|
|
return $this->content; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Set the value of content |
167
|
|
|
*/ |
168
|
|
|
public function setContent($content): self |
169
|
|
|
{ |
170
|
|
|
$this->content = $content; |
171
|
|
|
|
172
|
|
|
return $this; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* Get the value of model |
177
|
|
|
*/ |
178
|
|
|
public function getModel() |
179
|
|
|
{ |
180
|
|
|
return $this->model; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Set the value of model |
185
|
|
|
*/ |
186
|
|
|
public function setModel($model): self |
187
|
|
|
{ |
188
|
|
|
$this->model = $model; |
189
|
|
|
|
190
|
|
|
return $this; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Get the value of context |
195
|
|
|
*/ |
196
|
|
|
public function getContext() |
197
|
|
|
{ |
198
|
|
|
return $this->context; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* Set the value of context |
203
|
|
|
*/ |
204
|
|
|
public function setContext($context): self |
205
|
|
|
{ |
206
|
|
|
$this->context = $context; |
207
|
|
|
|
208
|
|
|
return $this; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* Get the value of signer |
213
|
|
|
*/ |
214
|
|
|
public function getSigner() |
215
|
|
|
{ |
216
|
|
|
return $this->signer; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* Set the value of signer |
221
|
|
|
*/ |
222
|
|
|
public function setSigner($signer): self |
223
|
|
|
{ |
224
|
|
|
$this->signer = $signer; |
225
|
|
|
|
226
|
|
|
return $this; |
227
|
|
|
} |
228
|
|
|
} |
229
|
|
|
|
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