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