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