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