|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
|
|
6
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\ApiProperty; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
|
|
12
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
13
|
|
|
use Symfony\Component\Serializer\Annotation\Groups; |
|
|
|
|
|
|
14
|
|
|
use stdClass; |
|
15
|
|
|
/** |
|
16
|
|
|
* TaskInteration |
|
17
|
|
|
* |
|
18
|
|
|
* @ORM\EntityListeners ({App\Listener\LogListener::class}) |
|
19
|
|
|
* @ORM\Entity () |
|
20
|
|
|
* @ORM\Table (name="task_interations") |
|
21
|
|
|
*/ |
|
22
|
|
|
#[ApiResource(operations: [new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['task_interaction_write']]), new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')'), new Post(uriTemplate: 'task_interations/task/{task_id}', controller: \App\Controller\CreateTaskInteractionAction::class, security: 'is_granted(\'ROLE_CLIENT\')', deserialize: false, openapiContext: ['consumes' => ['multipart/form-data']])], formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], security: 'is_granted(\'ROLE_CLIENT\')', normalizationContext: ['groups' => ['task_interaction_read']], denormalizationContext: ['groups' => ['task_interaction_write']])] |
|
23
|
|
|
#[ApiFilter(filterClass: SearchFilter::class, properties: ['task' => 'exact', 'task.id' => 'exact', 'task.taskFor' => 'exact', 'registeredBy' => 'exact', 'type' => 'exact', 'visibility' => 'exact', 'read' => 'exact'])] |
|
24
|
|
|
class TaskInteration |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* |
|
28
|
|
|
* @ORM\Column(type="integer", nullable=false) |
|
29
|
|
|
* @ORM\Id |
|
30
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
|
31
|
|
|
* @Groups({"task_interaction_read"}) |
|
32
|
|
|
*/ |
|
33
|
|
|
private $id; |
|
34
|
|
|
/** |
|
35
|
|
|
* |
|
36
|
|
|
* @ORM\Column(type="string", length=50, nullable=false) |
|
37
|
|
|
* @Groups({"task_interaction_read"}) |
|
38
|
|
|
*/ |
|
39
|
|
|
private $type; |
|
40
|
|
|
/** |
|
41
|
|
|
* |
|
42
|
|
|
* @ORM\Column(name="visibility",type="string", length=50, nullable=false) |
|
43
|
|
|
* @Groups({"task_interaction_read"}) |
|
44
|
|
|
*/ |
|
45
|
|
|
private $visibility; |
|
46
|
|
|
/** |
|
47
|
|
|
* |
|
48
|
|
|
* @ORM\Column(type="string", nullable=true) |
|
49
|
|
|
* @Groups({"task_interaction_read"}) |
|
50
|
|
|
*/ |
|
51
|
|
|
private $body; |
|
52
|
|
|
/** |
|
53
|
|
|
* @var \ControleOnline\Entity\People |
|
|
|
|
|
|
54
|
|
|
* |
|
55
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People") |
|
56
|
|
|
* @ORM\JoinColumns({ |
|
57
|
|
|
* @ORM\JoinColumn(name="registered_by_id", referencedColumnName="id", nullable=false) |
|
58
|
|
|
* }) |
|
59
|
|
|
* @Groups({"task_interaction_read"}) |
|
60
|
|
|
*/ |
|
61
|
|
|
private $registeredBy; |
|
62
|
|
|
/** |
|
63
|
|
|
* @var \ControleOnline\Entity\Task |
|
64
|
|
|
* |
|
65
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Task") |
|
66
|
|
|
* @ORM\JoinColumns({ |
|
67
|
|
|
* @ORM\JoinColumn(name="task_id", referencedColumnName="id", nullable=true) |
|
68
|
|
|
* }) |
|
69
|
|
|
* |
|
70
|
|
|
* @Groups({"task_interaction_read"}) |
|
71
|
|
|
*/ |
|
72
|
|
|
private $task; |
|
73
|
|
|
/** |
|
74
|
|
|
* @var \ControleOnline\Entity\File |
|
|
|
|
|
|
75
|
|
|
* |
|
76
|
|
|
* @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File") |
|
77
|
|
|
* @ORM\JoinColumns({ |
|
78
|
|
|
* @ORM\JoinColumn(name="file_id", referencedColumnName="id", nullable=true) |
|
79
|
|
|
* }) |
|
80
|
|
|
* @Groups({"task_interaction_read"}) |
|
81
|
|
|
*/ |
|
82
|
|
|
private $file; |
|
83
|
|
|
/** |
|
84
|
|
|
* @var \DateTimeInterface |
|
85
|
|
|
* @ORM\Column(name="created_at", type="datetime", nullable=false, columnDefinition="DATETIME") |
|
86
|
|
|
* @Groups({"task_interaction_read"}) |
|
87
|
|
|
*/ |
|
88
|
|
|
private $createdAt; |
|
89
|
|
|
/** |
|
90
|
|
|
* @ORM\Column(name="`read`", type="integer", nullable=false,) |
|
91
|
|
|
* @Groups({"task_interaction_read","task_interaction_write"}) |
|
92
|
|
|
*/ |
|
93
|
|
|
private $read; |
|
94
|
|
|
/** |
|
95
|
|
|
* Constructor |
|
96
|
|
|
*/ |
|
97
|
|
|
public function __construct() |
|
98
|
|
|
{ |
|
99
|
|
|
$this->createdAt = new \DateTime('now'); |
|
100
|
|
|
$this->body = json_encode(new stdClass()); |
|
101
|
|
|
$this->visibility = 'private'; |
|
102
|
|
|
} |
|
103
|
|
|
/** |
|
104
|
|
|
* Get the value of id |
|
105
|
|
|
*/ |
|
106
|
|
|
public function getId() |
|
107
|
|
|
{ |
|
108
|
|
|
return $this->id; |
|
109
|
|
|
} |
|
110
|
|
|
/** |
|
111
|
|
|
* Get the value of type |
|
112
|
|
|
*/ |
|
113
|
|
|
public function getType() |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->type; |
|
116
|
|
|
} |
|
117
|
|
|
/** |
|
118
|
|
|
* Set the value of type |
|
119
|
|
|
*/ |
|
120
|
|
|
public function setType($type) : self |
|
121
|
|
|
{ |
|
122
|
|
|
$this->type = $type; |
|
123
|
|
|
return $this; |
|
124
|
|
|
} |
|
125
|
|
|
/** |
|
126
|
|
|
* Get body |
|
127
|
|
|
* |
|
128
|
|
|
* @return string |
|
129
|
|
|
*/ |
|
130
|
|
|
public function getBody() |
|
131
|
|
|
{ |
|
132
|
|
|
return $this->body; |
|
133
|
|
|
} |
|
134
|
|
|
/** |
|
135
|
|
|
* Set body |
|
136
|
|
|
* |
|
137
|
|
|
* @param string $body |
|
138
|
|
|
* @return TaskInteration |
|
139
|
|
|
*/ |
|
140
|
|
|
public function setBody($body) |
|
141
|
|
|
{ |
|
142
|
|
|
$this->body = $body; |
|
143
|
|
|
return $this; |
|
144
|
|
|
} |
|
145
|
|
|
/** |
|
146
|
|
|
* Get the value of registeredBy |
|
147
|
|
|
*/ |
|
148
|
|
|
public function getRegisteredBy() |
|
149
|
|
|
{ |
|
150
|
|
|
return $this->registeredBy; |
|
151
|
|
|
} |
|
152
|
|
|
/** |
|
153
|
|
|
* Set the value of registeredBy |
|
154
|
|
|
*/ |
|
155
|
|
|
public function setRegisteredBy($registeredBy) : self |
|
156
|
|
|
{ |
|
157
|
|
|
$this->registeredBy = $registeredBy; |
|
158
|
|
|
return $this; |
|
159
|
|
|
} |
|
160
|
|
|
/** |
|
161
|
|
|
* Get the value of task |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getTask() |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->task; |
|
166
|
|
|
} |
|
167
|
|
|
/** |
|
168
|
|
|
* Set the value of task |
|
169
|
|
|
*/ |
|
170
|
|
|
public function setTask($task) : self |
|
171
|
|
|
{ |
|
172
|
|
|
$this->task = $task; |
|
173
|
|
|
return $this; |
|
174
|
|
|
} |
|
175
|
|
|
/** |
|
176
|
|
|
* Get the value of file |
|
177
|
|
|
*/ |
|
178
|
|
|
public function getFile() |
|
179
|
|
|
{ |
|
180
|
|
|
return $this->file; |
|
181
|
|
|
} |
|
182
|
|
|
/** |
|
183
|
|
|
* Set the value of file |
|
184
|
|
|
*/ |
|
185
|
|
|
public function setFile($file) : self |
|
186
|
|
|
{ |
|
187
|
|
|
$this->file = $file; |
|
188
|
|
|
return $this; |
|
189
|
|
|
} |
|
190
|
|
|
/** |
|
191
|
|
|
* Get the value of createdAt |
|
192
|
|
|
*/ |
|
193
|
|
|
public function getCreatedAt() |
|
194
|
|
|
{ |
|
195
|
|
|
return $this->createdAt; |
|
196
|
|
|
} |
|
197
|
|
|
/** |
|
198
|
|
|
* Get the value of visibility |
|
199
|
|
|
*/ |
|
200
|
|
|
public function getVisibility() |
|
201
|
|
|
{ |
|
202
|
|
|
return $this->visibility; |
|
203
|
|
|
} |
|
204
|
|
|
/** |
|
205
|
|
|
* Set the value of visibility |
|
206
|
|
|
*/ |
|
207
|
|
|
public function setVisibility($visibility) : self |
|
208
|
|
|
{ |
|
209
|
|
|
$this->visibility = $visibility; |
|
210
|
|
|
return $this; |
|
211
|
|
|
} |
|
212
|
|
|
/** |
|
213
|
|
|
* Get the value of read |
|
214
|
|
|
*/ |
|
215
|
|
|
public function getRead() |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->read; |
|
218
|
|
|
} |
|
219
|
|
|
/** |
|
220
|
|
|
* Set the value of read |
|
221
|
|
|
*/ |
|
222
|
|
|
public function setRead($read) |
|
223
|
|
|
{ |
|
224
|
|
|
$this->read = $read; |
|
225
|
|
|
return $this; |
|
226
|
|
|
} |
|
227
|
|
|
} |
|
228
|
|
|
|
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