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