1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Entity; |
4
|
|
|
|
5
|
|
|
use Ds\Component\Model\Attribute\Accessor; |
|
|
|
|
6
|
|
|
use Ds\Component\Model\Type\Deletable; |
|
|
|
|
7
|
|
|
use Ds\Component\Model\Type\Identifiable; |
|
|
|
|
8
|
|
|
use Ds\Component\Model\Type\Uuidentifiable; |
|
|
|
|
9
|
|
|
use Ds\Component\Model\Type\Ownable; |
|
|
|
|
10
|
|
|
use Ds\Component\Model\Type\Identitiable; |
|
|
|
|
11
|
|
|
use Ds\Component\Model\Type\Versionable; |
|
|
|
|
12
|
|
|
use App\Entity\Attribute\Accessor as ServiceAccessor; |
13
|
|
|
use Ds\Component\Tenant\Model\Attribute\Accessor as TenantAccessor; |
|
|
|
|
14
|
|
|
use Ds\Component\Tenant\Model\Type\Tenantable; |
|
|
|
|
15
|
|
|
use Knp\DoctrineBehaviors\Model as Behavior; |
|
|
|
|
16
|
|
|
|
17
|
|
|
use ApiPlatform\Core\Annotation\ApiResource; |
|
|
|
|
18
|
|
|
use ApiPlatform\Core\Annotation\ApiProperty; |
|
|
|
|
19
|
|
|
use Symfony\Component\Serializer\Annotation as Serializer; |
|
|
|
|
20
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
|
|
|
21
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
22
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints as ORMAssert; |
|
|
|
|
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Class Submission |
26
|
|
|
* |
27
|
|
|
* @ApiResource( |
28
|
|
|
* attributes={ |
29
|
|
|
* "normalization_context"={ |
30
|
|
|
* "groups"={"submission_output"} |
31
|
|
|
* }, |
32
|
|
|
* "denormalization_context"={ |
33
|
|
|
* "groups"={"submission_input"} |
34
|
|
|
* }, |
35
|
|
|
* "filters"={ |
36
|
|
|
* "app.submission.search", |
37
|
|
|
* "app.submission.date", |
38
|
|
|
* "app.submission.boolean", |
39
|
|
|
* "app.submission.order" |
40
|
|
|
* } |
41
|
|
|
* } |
42
|
|
|
* ) |
43
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\SubmissionRepository") |
44
|
|
|
* @ORM\Table(name="app_submission") |
45
|
|
|
* @ORM\Cache(usage="NONSTRICT_READ_WRITE") |
46
|
|
|
* @ORMAssert\UniqueEntity(fields="uuid") |
47
|
|
|
*/ |
48
|
|
|
class Submission implements Identifiable, Uuidentifiable, Ownable, Identitiable, Deletable, Versionable, Tenantable |
49
|
|
|
{ |
50
|
|
|
use Behavior\Timestampable\Timestampable; |
|
|
|
|
51
|
|
|
use Behavior\SoftDeletable\SoftDeletable; |
|
|
|
|
52
|
|
|
|
53
|
|
|
use Accessor\Id; |
|
|
|
|
54
|
|
|
use Accessor\Uuid; |
|
|
|
|
55
|
|
|
use Accessor\Owner; |
|
|
|
|
56
|
|
|
use Accessor\OwnerUuid; |
|
|
|
|
57
|
|
|
use Accessor\Identity; |
|
|
|
|
58
|
|
|
use Accessor\IdentityUuid; |
|
|
|
|
59
|
|
|
use Accessor\Data; |
|
|
|
|
60
|
|
|
use Accessor\State; |
|
|
|
|
61
|
|
|
use Accessor\Deleted; |
|
|
|
|
62
|
|
|
use Accessor\Version; |
|
|
|
|
63
|
|
|
use ServiceAccessor\Scenario; |
64
|
|
|
use TenantAccessor\Tenant; |
|
|
|
|
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @const integer |
68
|
|
|
*/ |
69
|
|
|
const STATE_DRAFT = 0; |
70
|
|
|
const STATE_SUBMITTED = 1; |
71
|
|
|
const STATE_TRANSFERRED = 2; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var integer |
75
|
|
|
* @ApiProperty(identifier=false, writable=false) |
76
|
|
|
* @Serializer\Groups({"submission_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({"submission_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({"submission_output"}) |
96
|
|
|
*/ |
97
|
|
|
protected $createdAt; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var \DateTime |
101
|
|
|
* @ApiProperty(writable=false) |
102
|
|
|
* @Serializer\Groups({"submission_output"}) |
103
|
|
|
*/ |
104
|
|
|
protected $updatedAt; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @var \DateTime |
108
|
|
|
* @ApiProperty(writable=false) |
109
|
|
|
* @Serializer\Groups({"submission_output"}) |
110
|
|
|
*/ |
111
|
|
|
protected $deletedAt; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @var string |
115
|
|
|
* @ApiProperty |
116
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
117
|
|
|
* @ORM\Column(name="`owner`", type="string", length=255, nullable=true) |
118
|
|
|
*/ |
119
|
|
|
private $owner; |
|
|
|
|
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @var string |
123
|
|
|
* @ApiProperty |
124
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
125
|
|
|
* @ORM\Column(name="owner_uuid", type="guid", nullable=true) |
126
|
|
|
* @Assert\Uuid |
127
|
|
|
*/ |
128
|
|
|
private $ownerUuid; |
|
|
|
|
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @var string |
132
|
|
|
* @ApiProperty |
133
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
134
|
|
|
* @ORM\Column(name="identity", type="string", length=255, nullable=true) |
135
|
|
|
*/ |
136
|
|
|
private $identity; |
|
|
|
|
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @var string |
140
|
|
|
* @ApiProperty |
141
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
142
|
|
|
* @ORM\Column(name="identity_uuid", type="guid", nullable=true) |
143
|
|
|
* @Assert\Uuid |
144
|
|
|
*/ |
145
|
|
|
private $identityUuid; |
|
|
|
|
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @var \App\Entity\Scenario |
149
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
150
|
|
|
* @ORM\ManyToOne(targetEntity="Scenario", inversedBy="submissions") |
151
|
|
|
* @ORM\JoinColumn(name="scenario_id", referencedColumnName="id") |
152
|
|
|
* @Assert\Valid |
153
|
|
|
*/ |
154
|
|
|
private $scenario; |
|
|
|
|
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @var array |
158
|
|
|
* @ApiProperty |
159
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
160
|
|
|
* @ORM\Column(name="data", type="json_array") |
161
|
|
|
* @Assert\Type("array") |
162
|
|
|
*/ |
163
|
|
|
private $data; |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @var integer |
167
|
|
|
* @ApiProperty |
168
|
|
|
* @Serializer\Groups({"submission_output", "submission_input"}) |
169
|
|
|
* @ORM\Column(name="state", type="smallint", options={"unsigned"=true}) |
170
|
|
|
*/ |
171
|
|
|
private $state; |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @var integer |
175
|
|
|
* @ApiProperty |
176
|
|
|
* @Serializer\Groups({"submission_output", "submission_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({"submission_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->data = []; |
199
|
|
|
$this->state = static::STATE_DRAFT; |
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