1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Entity; |
4
|
|
|
|
5
|
|
|
use App\Entity\Attribute\Accessor as CaseAccessor; |
6
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
|
7
|
|
|
use Ds\Component\Locale\Model\Type\Localizable; |
|
|
|
|
8
|
|
|
use Ds\Component\Model\Type\CustomIdentifiable; |
|
|
|
|
9
|
|
|
use Ds\Component\Model\Type\Deletable; |
|
|
|
|
10
|
|
|
use Ds\Component\Model\Type\Identifiable; |
|
|
|
|
11
|
|
|
use Ds\Component\Model\Type\Uuidentifiable; |
|
|
|
|
12
|
|
|
use Ds\Component\Model\Type\Ownable; |
|
|
|
|
13
|
|
|
use Ds\Component\Model\Type\Identitiable; |
|
|
|
|
14
|
|
|
use Ds\Component\Model\Type\Versionable; |
|
|
|
|
15
|
|
|
use Ds\Component\Model\Attribute\Accessor; |
|
|
|
|
16
|
|
|
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor; |
|
|
|
|
17
|
|
|
use Ds\Component\Tenant\Model\Type\Tenantable; |
|
|
|
|
18
|
|
|
use Ds\Component\Translation\Model\Attribute\Accessor as TranslationAccessor; |
|
|
|
|
19
|
|
|
use Ds\Component\Translation\Model\Type\Translatable; |
|
|
|
|
20
|
|
|
use Knp\DoctrineBehaviors\Model as Behavior; |
|
|
|
|
21
|
|
|
|
22
|
|
|
use ApiPlatform\Core\Annotation\ApiResource; |
|
|
|
|
23
|
|
|
use ApiPlatform\Core\Annotation\ApiProperty; |
|
|
|
|
24
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
25
|
|
|
use Ds\Component\Locale\Model\Annotation\Locale; |
|
|
|
|
26
|
|
|
use Ds\Component\Translation\Model\Annotation\Translate; |
|
|
|
|
27
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert; |
|
|
|
|
28
|
|
|
use Symfony\Component\Serializer\Annotation as Serializer; |
|
|
|
|
29
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
|
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Class CaseEntity |
33
|
|
|
* |
34
|
|
|
* @ApiResource( |
35
|
|
|
* shortName="Case", |
36
|
|
|
* attributes={ |
37
|
|
|
* "normalization_context"={ |
38
|
|
|
* "groups"={"case_output"} |
39
|
|
|
* }, |
40
|
|
|
* "denormalization_context"={ |
41
|
|
|
* "groups"={"case_input"} |
42
|
|
|
* }, |
43
|
|
|
* "filters"={ |
44
|
|
|
* "app.case.search", |
45
|
|
|
* "app.case.search_translation", |
46
|
|
|
* "app.case.date", |
47
|
|
|
* "app.case.order" |
48
|
|
|
* } |
49
|
|
|
* } |
50
|
|
|
* ) |
51
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\CaseRepository") |
52
|
|
|
* @ORM\Table( |
53
|
|
|
* name="app_case", |
54
|
|
|
* uniqueConstraints={ |
55
|
|
|
* @ORM\UniqueConstraint(columns={"custom_id", "tenant"}) |
56
|
|
|
* } |
57
|
|
|
* ) |
58
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
59
|
|
|
* @ORMAssert\UniqueEntity(fields="uuid") |
60
|
|
|
* @ORMAssert\UniqueEntity(fields={"customId", "tenant"}) |
61
|
|
|
*/ |
62
|
|
|
class CaseEntity implements Identifiable, Uuidentifiable, CustomIdentifiable, Ownable, Translatable, Localizable, Identitiable, Deletable, Versionable, Tenantable |
63
|
|
|
{ |
64
|
|
|
use Behavior\Translatable\Translatable; |
|
|
|
|
65
|
|
|
use Behavior\Timestampable\Timestampable; |
|
|
|
|
66
|
|
|
use Behavior\SoftDeletable\SoftDeletable; |
|
|
|
|
67
|
|
|
|
68
|
|
|
use Accessor\Id; |
|
|
|
|
69
|
|
|
use Accessor\Uuid; |
|
|
|
|
70
|
|
|
use Accessor\CustomId; |
|
|
|
|
71
|
|
|
use Accessor\Owner; |
|
|
|
|
72
|
|
|
use Accessor\OwnerUuid; |
|
|
|
|
73
|
|
|
use Accessor\Identity; |
|
|
|
|
74
|
|
|
use Accessor\IdentityUuid; |
|
|
|
|
75
|
|
|
use TranslationAccessor\Title; |
|
|
|
|
76
|
|
|
use TranslationAccessor\Data; |
|
|
|
|
77
|
|
|
use Accessor\State; |
|
|
|
|
78
|
|
|
use Accessor\Priority; |
|
|
|
|
79
|
|
|
use CaseAccessor\Statuses; |
80
|
|
|
use Accessor\Deleted; |
|
|
|
|
81
|
|
|
use Accessor\Version; |
|
|
|
|
82
|
|
|
use TenantAccessor\Tenant; |
|
|
|
|
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @const string |
86
|
|
|
*/ |
87
|
|
|
const STATE_OPEN = 1; |
88
|
|
|
const STATE_CLOSED = 2; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Returns translation entity class name |
92
|
|
|
* |
93
|
|
|
* @return string |
94
|
|
|
*/ |
95
|
|
|
public static function getTranslationEntityClass() |
96
|
|
|
{ |
97
|
|
|
return '\App\Entity\CaseTranslation'; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @var integer |
102
|
|
|
* @ApiProperty(identifier=false, writable=false) |
103
|
|
|
* @Serializer\Groups({"case_output"}) |
104
|
|
|
* @ORM\Id |
105
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
106
|
|
|
* @ORM\Column(name="id", type="integer") |
107
|
|
|
*/ |
108
|
|
|
private $id; |
|
|
|
|
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @var string |
112
|
|
|
* @ApiProperty(identifier=true, writable=false) |
113
|
|
|
* @Serializer\Groups({"case_output"}) |
114
|
|
|
* @ORM\Column(name="uuid", type="guid", unique=true) |
115
|
|
|
* @Assert\Uuid |
116
|
|
|
*/ |
117
|
|
|
private $uuid; |
|
|
|
|
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @var string |
121
|
|
|
* @ApiProperty |
122
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
123
|
|
|
* @ORM\Column(name="custom_id", type="string", length=255, nullable=true) |
124
|
|
|
*/ |
125
|
|
|
private $customId; |
|
|
|
|
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var \DateTime |
129
|
|
|
* @ApiProperty(writable=false) |
130
|
|
|
* @Serializer\Groups({"case_output"}) |
131
|
|
|
*/ |
132
|
|
|
protected $createdAt; |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @var \DateTime |
136
|
|
|
* @ApiProperty(writable=false) |
137
|
|
|
* @Serializer\Groups({"case_output"}) |
138
|
|
|
*/ |
139
|
|
|
protected $updatedAt; |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @var \DateTime |
143
|
|
|
* @ApiProperty(writable=false) |
144
|
|
|
* @Serializer\Groups({"case_output"}) |
145
|
|
|
*/ |
146
|
|
|
protected $deletedAt; |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @var string |
150
|
|
|
* @ApiProperty |
151
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
152
|
|
|
* @ORM\Column(name="`owner`", type="string", length=255, nullable=true) |
153
|
|
|
* @Assert\NotBlank |
154
|
|
|
* @Assert\Length(min=1, max=255) |
155
|
|
|
*/ |
156
|
|
|
private $owner; |
|
|
|
|
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @var string |
160
|
|
|
* @ApiProperty |
161
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
162
|
|
|
* @ORM\Column(name="owner_uuid", type="guid", nullable=true) |
163
|
|
|
* @Assert\NotBlank |
164
|
|
|
* @Assert\Uuid |
165
|
|
|
*/ |
166
|
|
|
private $ownerUuid; |
|
|
|
|
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @var string |
170
|
|
|
* @ApiProperty |
171
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
172
|
|
|
* @ORM\Column(name="identity", type="string", length=255, nullable=true) |
173
|
|
|
* @Assert\NotBlank |
174
|
|
|
* @Assert\Length(min=1, max=255) |
175
|
|
|
*/ |
176
|
|
|
private $identity; |
|
|
|
|
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* @var string |
180
|
|
|
* @ApiProperty |
181
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
182
|
|
|
* @ORM\Column(name="identity_uuid", type="guid", nullable=true) |
183
|
|
|
* @Assert\NotBlank |
184
|
|
|
* @Assert\Uuid |
185
|
|
|
*/ |
186
|
|
|
private $identityUuid; |
|
|
|
|
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @var array |
190
|
|
|
* @ApiProperty |
191
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
192
|
|
|
* @Assert\Type("array") |
193
|
|
|
* @Assert\NotBlank |
194
|
|
|
* @Assert\All({ |
195
|
|
|
* @Assert\NotBlank, |
196
|
|
|
* @Assert\Length(min=1) |
197
|
|
|
* }) |
198
|
|
|
* @Locale |
199
|
|
|
* @Translate |
200
|
|
|
*/ |
201
|
|
|
private $title; |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @var array |
205
|
|
|
* @ApiProperty |
206
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
207
|
|
|
* @Assert\Type("array") |
208
|
|
|
* @Assert\NotBlank |
209
|
|
|
* @Assert\All({ |
210
|
|
|
* @Assert\Type("array") |
211
|
|
|
* }) |
212
|
|
|
* @Locale |
213
|
|
|
* @Translate |
214
|
|
|
*/ |
215
|
|
|
private $data; |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @var string |
219
|
|
|
* @ApiProperty |
220
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
221
|
|
|
* @ORM\Column(name="state", type="integer", options={"default":0}) |
222
|
|
|
* @Assert\Type("integer") |
223
|
|
|
*/ |
224
|
|
|
private $state; |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* @var integer |
228
|
|
|
* @ApiProperty |
229
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
230
|
|
|
* @ORM\Column(name="priority", type="integer", options={"default":0}) |
231
|
|
|
* @Assert\NotBlank |
232
|
|
|
* @Assert\Type("integer") |
233
|
|
|
*/ |
234
|
|
|
private $priority; |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @var \Doctrine\Common\Collections\ArrayCollection |
238
|
|
|
* @ApiProperty(writable=false) |
239
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
240
|
|
|
* @ORM\OneToMany(targetEntity="CaseStatus", mappedBy="case") |
241
|
|
|
* @ORM\OrderBy({"id"="ASC"}) |
242
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
243
|
|
|
*/ |
244
|
|
|
private $statuses; |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @var integer |
248
|
|
|
* @ApiProperty |
249
|
|
|
* @Serializer\Groups({"case_output", "case_input"}) |
250
|
|
|
* @ORM\Column(name="version", type="integer") |
251
|
|
|
* @ORM\Version |
252
|
|
|
* @Assert\NotBlank |
253
|
|
|
* @Assert\Type("integer") |
254
|
|
|
*/ |
255
|
|
|
private $version; |
|
|
|
|
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @var string |
259
|
|
|
* @ApiProperty(writable=false) |
260
|
|
|
* @Serializer\Groups({"case_output"}) |
261
|
|
|
* @ORM\Column(name="tenant", type="guid") |
262
|
|
|
* @Assert\Uuid |
263
|
|
|
*/ |
264
|
|
|
private $tenant; |
|
|
|
|
265
|
|
|
|
266
|
|
|
/** |
267
|
|
|
* Constructor |
268
|
|
|
*/ |
269
|
|
|
public function __construct() |
270
|
|
|
{ |
271
|
|
|
$this->title = []; |
272
|
|
|
$this->data = []; |
273
|
|
|
$this->state = static::STATE_OPEN; |
274
|
|
|
$this->statuses = new ArrayCollection; |
275
|
|
|
$this->priority = 0; |
276
|
|
|
} |
277
|
|
|
} |
278
|
|
|
|
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