1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Entity; |
4
|
|
|
|
5
|
|
|
use Ds\Component\Locale\Model\Type\Localizable; |
|
|
|
|
6
|
|
|
use Ds\Component\Model\Attribute\Accessor; |
|
|
|
|
7
|
|
|
use Ds\Component\Model\Type\Deletable; |
|
|
|
|
8
|
|
|
use Ds\Component\Model\Type\Identifiable; |
|
|
|
|
9
|
|
|
use Ds\Component\Model\Type\Ownable; |
|
|
|
|
10
|
|
|
use Ds\Component\Model\Type\Uuidentifiable; |
|
|
|
|
11
|
|
|
use Ds\Component\Model\Type\Versionable; |
|
|
|
|
12
|
|
|
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor; |
|
|
|
|
13
|
|
|
use Ds\Component\Tenant\Model\Type\Tenantable; |
|
|
|
|
14
|
|
|
use Ds\Component\Translation\Model\Attribute\Accessor as TranslationAccessor; |
|
|
|
|
15
|
|
|
use Ds\Component\Translation\Model\Type\Translatable; |
|
|
|
|
16
|
|
|
use Knp\DoctrineBehaviors\Model as Behavior; |
|
|
|
|
17
|
|
|
|
18
|
|
|
use ApiPlatform\Core\Annotation\ApiResource; |
|
|
|
|
19
|
|
|
use ApiPlatform\Core\Annotation\ApiProperty; |
|
|
|
|
20
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
21
|
|
|
use Ds\Component\Locale\Model\Annotation\Locale; |
|
|
|
|
22
|
|
|
use Ds\Component\Translation\Model\Annotation\Translate; |
|
|
|
|
23
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert; |
|
|
|
|
24
|
|
|
use Symfony\Component\Serializer\Annotation as Serializer; |
|
|
|
|
25
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
|
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Class File |
29
|
|
|
* |
30
|
|
|
* @ApiResource( |
31
|
|
|
* attributes={ |
32
|
|
|
* "normalization_context"={ |
33
|
|
|
* "groups"={"file_output"} |
34
|
|
|
* }, |
35
|
|
|
* "denormalization_context"={ |
36
|
|
|
* "groups"={"file_input"} |
37
|
|
|
* }, |
38
|
|
|
* "filters"={ |
39
|
|
|
* "app.file.search", |
40
|
|
|
* "app.file.search_translation", |
41
|
|
|
* "app.file.date", |
42
|
|
|
* "app.file.order" |
43
|
|
|
* } |
44
|
|
|
* } |
45
|
|
|
* ) |
46
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\FileRepository") |
47
|
|
|
* @ORM\Table( |
48
|
|
|
* name="app_file", |
49
|
|
|
* uniqueConstraints={ |
50
|
|
|
* @ORM\UniqueConstraint(columns={"slug", "tenant"}) |
51
|
|
|
* } |
52
|
|
|
* ) |
53
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
54
|
|
|
* @ORMAssert\UniqueEntity(fields="uuid") |
55
|
|
|
* @ORMAssert\UniqueEntity(fields={"slug", "tenant"}) |
56
|
|
|
*/ |
57
|
|
|
class File implements Identifiable, Uuidentifiable, Ownable, Translatable, Localizable, Deletable, Versionable, Tenantable |
58
|
|
|
{ |
59
|
|
|
use Behavior\Translatable\Translatable; |
|
|
|
|
60
|
|
|
use Behavior\Timestampable\Timestampable; |
|
|
|
|
61
|
|
|
use Behavior\SoftDeletable\SoftDeletable; |
|
|
|
|
62
|
|
|
|
63
|
|
|
use Accessor\Id; |
|
|
|
|
64
|
|
|
use Accessor\Uuid; |
|
|
|
|
65
|
|
|
use Accessor\Owner; |
|
|
|
|
66
|
|
|
use Accessor\OwnerUuid; |
|
|
|
|
67
|
|
|
use Accessor\Slug; |
|
|
|
|
68
|
|
|
use TranslationAccessor\Title; |
|
|
|
|
69
|
|
|
use TranslationAccessor\Description; |
|
|
|
|
70
|
|
|
use TranslationAccessor\Presentation; |
|
|
|
|
71
|
|
|
use Accessor\Type; |
|
|
|
|
72
|
|
|
use Accessor\Deleted; |
|
|
|
|
73
|
|
|
use Accessor\Version; |
|
|
|
|
74
|
|
|
use TenantAccessor\Tenant; |
|
|
|
|
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var integer |
78
|
|
|
* @ApiProperty(identifier=false, writable=false) |
79
|
|
|
* @Serializer\Groups({"file_output"}) |
80
|
|
|
* @ORM\Id |
81
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
82
|
|
|
* @ORM\Column(name="id", type="integer") |
83
|
|
|
*/ |
84
|
|
|
private $id; |
|
|
|
|
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @var string |
88
|
|
|
* @ApiProperty(identifier=true, writable=false) |
89
|
|
|
* @Serializer\Groups({"file_output"}) |
90
|
|
|
* @ORM\Column(name="uuid", type="guid", unique=true) |
91
|
|
|
* @Assert\Uuid |
92
|
|
|
*/ |
93
|
|
|
private $uuid; |
|
|
|
|
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @var \DateTime |
97
|
|
|
* @ApiProperty(writable=false) |
98
|
|
|
* @Serializer\Groups({"file_output"}) |
99
|
|
|
*/ |
100
|
|
|
protected $createdAt; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var \DateTime |
104
|
|
|
* @ApiProperty(writable=false) |
105
|
|
|
* @Serializer\Groups({"file_output"}) |
106
|
|
|
*/ |
107
|
|
|
protected $updatedAt; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @var \DateTime |
111
|
|
|
* @ApiProperty(writable=false) |
112
|
|
|
* @Serializer\Groups({"file_output"}) |
113
|
|
|
*/ |
114
|
|
|
protected $deletedAt; |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @var string |
118
|
|
|
* @ApiProperty |
119
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
120
|
|
|
* @ORM\Column(name="`owner`", type="string", length=255, nullable=true) |
121
|
|
|
* @Assert\NotBlank |
122
|
|
|
* @Assert\Length(min=1, max=255) |
123
|
|
|
*/ |
124
|
|
|
private $owner; |
|
|
|
|
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @var string |
128
|
|
|
* @ApiProperty |
129
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
130
|
|
|
* @ORM\Column(name="owner_uuid", type="guid", nullable=true) |
131
|
|
|
* @Assert\NotBlank |
132
|
|
|
* @Assert\Uuid |
133
|
|
|
*/ |
134
|
|
|
private $ownerUuid; |
|
|
|
|
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @var string |
138
|
|
|
* @ApiProperty |
139
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
140
|
|
|
* @ORM\Column(name="slug", type="string") |
141
|
|
|
* @Assert\NotBlank |
142
|
|
|
* @Assert\Length(min=1, max=255) |
143
|
|
|
*/ |
144
|
|
|
private $slug; |
|
|
|
|
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @var array |
148
|
|
|
* @ApiProperty |
149
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
150
|
|
|
* @Assert\Type("array") |
151
|
|
|
* @Assert\NotBlank |
152
|
|
|
* @Assert\All({ |
153
|
|
|
* @Assert\NotBlank, |
154
|
|
|
* @Assert\Length(min=1) |
155
|
|
|
* }) |
156
|
|
|
* @Locale |
157
|
|
|
* @Translate |
158
|
|
|
*/ |
159
|
|
|
private $title; |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @var array |
163
|
|
|
* @ApiProperty |
164
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
165
|
|
|
* @Assert\Type("array") |
166
|
|
|
* @Assert\NotBlank |
167
|
|
|
* @Assert\All({ |
168
|
|
|
* @Assert\NotBlank, |
169
|
|
|
* @Assert\Length(min=1) |
170
|
|
|
* }) |
171
|
|
|
* @Locale |
172
|
|
|
* @Translate |
173
|
|
|
*/ |
174
|
|
|
private $description; |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @var array |
178
|
|
|
* @ApiProperty |
179
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
180
|
|
|
* @Assert\Type("array") |
181
|
|
|
* @Assert\NotBlank |
182
|
|
|
* @Assert\All({ |
183
|
|
|
* @Assert\NotBlank, |
184
|
|
|
* @Assert\Length(min=1) |
185
|
|
|
* }) |
186
|
|
|
* @Locale |
187
|
|
|
* @Translate |
188
|
|
|
*/ |
189
|
|
|
private $presentation; |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @var string |
193
|
|
|
* @ApiProperty |
194
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
195
|
|
|
* @ORM\Column(name="`type`", type="string", length=255, nullable=true) |
196
|
|
|
* @Assert\NotBlank |
197
|
|
|
* @Assert\Length(min=1, max=255) |
198
|
|
|
*/ |
199
|
|
|
private $type; |
|
|
|
|
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @var integer |
203
|
|
|
* @ApiProperty |
204
|
|
|
* @Serializer\Groups({"file_output", "file_input"}) |
205
|
|
|
* @ORM\Column(name="version", type="integer") |
206
|
|
|
* @ORM\Version |
207
|
|
|
* @Assert\NotBlank |
208
|
|
|
* @Assert\Type("integer") |
209
|
|
|
*/ |
210
|
|
|
private $version; |
|
|
|
|
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* @var string |
214
|
|
|
* @ApiProperty(writable=false) |
215
|
|
|
* @Serializer\Groups({"file_output"}) |
216
|
|
|
* @ORM\Column(name="tenant", type="guid") |
217
|
|
|
* @Assert\Uuid |
218
|
|
|
*/ |
219
|
|
|
private $tenant; |
|
|
|
|
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* Constructor |
223
|
|
|
*/ |
224
|
|
|
public function __construct() |
225
|
|
|
{ |
226
|
|
|
$this->title = []; |
227
|
|
|
$this->description = []; |
228
|
|
|
$this->presentation = []; |
229
|
|
|
} |
230
|
|
|
} |
231
|
|
|
|
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