1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Entity; |
4
|
|
|
|
5
|
|
|
use App\Entity\Attribute\Accessor as EntityAccessor; |
6
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
|
|
|
|
7
|
|
|
use Ds\Component\Model\Attribute\Accessor; |
|
|
|
|
8
|
|
|
use Ds\Component\Model\Type\Deletable; |
|
|
|
|
9
|
|
|
use Ds\Component\Model\Type\Identifiable; |
|
|
|
|
10
|
|
|
use Ds\Component\Model\Type\Identitiable; |
|
|
|
|
11
|
|
|
use Ds\Component\Model\Type\Ownable; |
|
|
|
|
12
|
|
|
use Ds\Component\Model\Type\Uuidentifiable; |
|
|
|
|
13
|
|
|
use Ds\Component\Model\Type\Versionable; |
|
|
|
|
14
|
|
|
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor; |
|
|
|
|
15
|
|
|
use Ds\Component\Tenant\Model\Type\Tenantable; |
|
|
|
|
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 Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert; |
|
|
|
|
22
|
|
|
use Symfony\Component\Serializer\Annotation As Serializer; |
|
|
|
|
23
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
|
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Class Staff |
27
|
|
|
* |
28
|
|
|
* @ApiResource( |
29
|
|
|
* shortName="staffs", |
30
|
|
|
* attributes={ |
31
|
|
|
* "normalization_context"={ |
32
|
|
|
* "groups"={"staff_output"} |
33
|
|
|
* }, |
34
|
|
|
* "denormalization_context"={ |
35
|
|
|
* "groups"={"staff_input"} |
36
|
|
|
* }, |
37
|
|
|
* "filters"={ |
38
|
|
|
* "app.staff.search", |
39
|
|
|
* "app.staff.date", |
40
|
|
|
* "app.staff.order" |
41
|
|
|
* } |
42
|
|
|
* } |
43
|
|
|
* ) |
44
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\StaffRepository") |
45
|
|
|
* @ORM\Table(name="app_staff") |
46
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
47
|
|
|
* @ORMAssert\UniqueEntity(fields="uuid") |
48
|
|
|
*/ |
49
|
|
|
class Staff implements Identifiable, Uuidentifiable, Ownable, Identitiable, Deletable, Versionable, Tenantable |
50
|
|
|
{ |
51
|
|
|
use Behavior\Timestampable\Timestampable; |
|
|
|
|
52
|
|
|
use Behavior\SoftDeletable\SoftDeletable; |
|
|
|
|
53
|
|
|
|
54
|
|
|
use Accessor\Id; |
|
|
|
|
55
|
|
|
use Accessor\Uuid; |
|
|
|
|
56
|
|
|
use Accessor\Owner; |
|
|
|
|
57
|
|
|
use Accessor\OwnerUuid; |
|
|
|
|
58
|
|
|
use EntityAccessor\Identity\Identity; |
59
|
|
|
use EntityAccessor\Identity\IdentityUuid; |
60
|
|
|
use EntityAccessor\Personas; |
61
|
|
|
use EntityAccessor\Roles; |
62
|
|
|
use EntityAccessor\BusinessUnits; |
63
|
|
|
use Accessor\Deleted; |
|
|
|
|
64
|
|
|
use Accessor\Version; |
|
|
|
|
65
|
|
|
use TenantAccessor\Tenant; |
|
|
|
|
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var integer |
69
|
|
|
* @ApiProperty(identifier=false, writable=false) |
70
|
|
|
* @Serializer\Groups({"staff_output"}) |
71
|
|
|
* @ORM\Id |
72
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
73
|
|
|
* @ORM\Column(name="id", type="integer") |
74
|
|
|
*/ |
75
|
|
|
private $id; |
|
|
|
|
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var string |
79
|
|
|
* @ApiProperty(identifier=true, writable=false) |
80
|
|
|
* @Serializer\Groups({"staff_output"}) |
81
|
|
|
* @ORM\Column(name="uuid", type="guid", unique=true) |
82
|
|
|
* @Assert\Uuid |
83
|
|
|
*/ |
84
|
|
|
private $uuid; |
|
|
|
|
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @var \DateTime |
88
|
|
|
* @ApiProperty(writable=false) |
89
|
|
|
* @Serializer\Groups({"staff_output"}) |
90
|
|
|
*/ |
91
|
|
|
protected $createdAt; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @var \DateTime |
95
|
|
|
* @ApiProperty(writable=false) |
96
|
|
|
* @Serializer\Groups({"staff_output"}) |
97
|
|
|
*/ |
98
|
|
|
protected $updatedAt; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @var \DateTime |
102
|
|
|
* @ApiProperty(writable=false) |
103
|
|
|
* @Serializer\Groups({"staff_output"}) |
104
|
|
|
*/ |
105
|
|
|
protected $deletedAt; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @var string |
109
|
|
|
* @ApiProperty |
110
|
|
|
* @Serializer\Groups({"staff_output", "staff_input"}) |
111
|
|
|
* @ORM\Column(name="`owner`", type="string", length=255, nullable=true) |
112
|
|
|
* @Assert\NotBlank |
113
|
|
|
* @Assert\Length(min=1, max=255) |
114
|
|
|
*/ |
115
|
|
|
private $owner; |
|
|
|
|
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @var string |
119
|
|
|
* @ApiProperty |
120
|
|
|
* @Serializer\Groups({"staff_output", "staff_input"}) |
121
|
|
|
* @ORM\Column(name="owner_uuid", type="guid", nullable=true) |
122
|
|
|
* @Assert\NotBlank |
123
|
|
|
* @Assert\Uuid |
124
|
|
|
*/ |
125
|
|
|
private $ownerUuid; |
|
|
|
|
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var \Doctrine\Common\Collections\ArrayCollection |
129
|
|
|
* @ApiProperty(writable=false) |
130
|
|
|
* @Serializer\Groups({"staff_output"}) |
131
|
|
|
* @ORM\OneToMany(targetEntity="StaffPersona", mappedBy="staff", cascade={"persist", "remove"}) |
132
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
133
|
|
|
*/ |
134
|
|
|
private $personas; |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @var \Doctrine\Common\Collections\ArrayCollection |
138
|
|
|
* @ApiProperty(writable=false) |
139
|
|
|
* @Serializer\Groups({"staff_output"}) |
140
|
|
|
* @ORM\OneToMany(targetEntity="StaffRole", mappedBy="staff", cascade={"persist", "remove"}) |
141
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
142
|
|
|
*/ |
143
|
|
|
private $roles; |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* @var \Doctrine\Common\Collections\Collection |
|
|
|
|
147
|
|
|
* @ApiProperty |
148
|
|
|
* @Serializer\Groups({"staff_output", "staff_input"}) |
149
|
|
|
* @ORM\ManyToMany(targetEntity="BusinessUnit", inversedBy="staffs") |
150
|
|
|
* @ORM\JoinTable( |
151
|
|
|
* name="app_staff_bu", |
152
|
|
|
* joinColumns={ |
153
|
|
|
* @ORM\JoinColumn(name="staff_id", referencedColumnName="id") |
154
|
|
|
* }, |
155
|
|
|
* inverseJoinColumns={ |
156
|
|
|
* @ORM\JoinColumn(name="bu_id", referencedColumnName="id") |
157
|
|
|
* } |
158
|
|
|
* ) |
159
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
160
|
|
|
*/ |
161
|
|
|
private $businessUnits; |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @var integer |
165
|
|
|
* @ApiProperty |
166
|
|
|
* @Serializer\Groups({"staff_output", "staff_input"}) |
167
|
|
|
* @ORM\Column(name="version", type="integer") |
168
|
|
|
* @ORM\Version |
169
|
|
|
* @Assert\NotBlank |
170
|
|
|
* @Assert\Type("integer") |
171
|
|
|
*/ |
172
|
|
|
private $version; |
|
|
|
|
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @var string |
176
|
|
|
* @ApiProperty(writable=false) |
177
|
|
|
* @Serializer\Groups({"staff_output"}) |
178
|
|
|
* @ORM\Column(name="tenant", type="guid") |
179
|
|
|
* @Assert\Uuid |
180
|
|
|
*/ |
181
|
|
|
private $tenant; |
|
|
|
|
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Constructor |
185
|
|
|
*/ |
186
|
|
|
public function __construct() |
187
|
|
|
{ |
188
|
|
|
$this->personas = new ArrayCollection; |
189
|
|
|
$this->roles = new ArrayCollection; |
190
|
|
|
$this->businessUnits = new ArrayCollection; |
191
|
|
|
} |
192
|
|
|
} |
193
|
|
|
|
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