|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Serializer\Attribute\Groups; |
|
|
|
|
|
|
6
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\ExistsFilter; |
|
|
|
|
|
|
7
|
|
|
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\ApiFilter; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
|
|
13
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
|
|
14
|
|
|
use ControleOnline\Listener\LogListener; |
|
|
|
|
|
|
15
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
16
|
|
|
use DateTime; |
|
17
|
|
|
|
|
18
|
|
|
#[ApiResource( |
|
19
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
20
|
|
|
security: "is_granted('ROLE_CLIENT')", |
|
21
|
|
|
normalizationContext: ['groups' => ['order_product_queue:read']], |
|
22
|
|
|
denormalizationContext: ['groups' => ['order_product_queue:write']], |
|
23
|
|
|
operations: [ |
|
24
|
|
|
new GetCollection(security: "is_granted('ROLE_CLIENT')"), |
|
25
|
|
|
new Get(security: "is_granted('ROLE_CLIENT')"), |
|
26
|
|
|
new Put(security: "is_granted('ROLE_CLIENT')"), |
|
27
|
|
|
new Delete(security: "is_granted('ROLE_CLIENT')"), |
|
28
|
|
|
] |
|
29
|
|
|
)] |
|
30
|
|
|
#[ORM\Table(name: 'order_product_queue')] |
|
31
|
|
|
#[ORM\Index(name: 'status_id', columns: ['status_id'])] |
|
32
|
|
|
#[ORM\Index(name: 'queue_id', columns: ['queue_id'])] |
|
33
|
|
|
#[ORM\Index(name: 'people_id', columns: ['order_id'])] |
|
34
|
|
|
#[ORM\EntityListeners([LogListener::class])] |
|
35
|
|
|
#[ORM\Entity] |
|
36
|
|
|
class OrderProductQueue |
|
37
|
|
|
{ |
|
38
|
|
|
#[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
|
39
|
|
|
#[ORM\Id] |
|
40
|
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
41
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
42
|
|
|
private $id; |
|
43
|
|
|
|
|
44
|
|
|
#[ORM\Column(name: 'priority', type: 'string', length: 0, nullable: false)] |
|
45
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
46
|
|
|
private $priority; |
|
47
|
|
|
|
|
48
|
|
|
#[ORM\Column(name: 'register_time', type: 'datetime', nullable: false, options: ['default' => 'current_timestamp()'])] |
|
49
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
50
|
|
|
private $registerTime; |
|
51
|
|
|
|
|
52
|
|
|
#[ORM\Column(name: 'update_time', type: 'datetime', nullable: false, options: ['default' => 'current_timestamp()'])] |
|
53
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
54
|
|
|
private $updateTime; |
|
55
|
|
|
|
|
56
|
|
|
#[ApiFilter(SearchFilter::class, properties: ['order_product.order.provider' => 'exact'])] |
|
57
|
|
|
#[ApiFilter(ExistsFilter::class, properties: ['order_product.parentProduct'])] |
|
58
|
|
|
#[ORM\JoinColumn(name: 'order_product_id', referencedColumnName: 'id')] |
|
59
|
|
|
#[ORM\ManyToOne(targetEntity: OrderProduct::class)] |
|
60
|
|
|
#[Groups(['order_product_queue:read', 'order_product_queue:write'])] |
|
61
|
|
|
private $order_product; |
|
62
|
|
|
|
|
63
|
|
|
#[ApiFilter(SearchFilter::class, properties: ['orderQueue.status.realStatus' => 'exact', 'status' => 'exact'])] |
|
64
|
|
|
#[ORM\JoinColumn(name: 'status_id', referencedColumnName: 'id')] |
|
65
|
|
|
#[ORM\ManyToOne(targetEntity: Status::class)] |
|
66
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
67
|
|
|
private $status; |
|
68
|
|
|
|
|
69
|
|
|
#[ApiFilter(SearchFilter::class, properties: ['queue' => 'exact'])] |
|
70
|
|
|
#[ORM\JoinColumn(name: 'queue_id', referencedColumnName: 'id')] |
|
71
|
|
|
#[ORM\ManyToOne(targetEntity: Queue::class)] |
|
72
|
|
|
#[Groups(['order:read', 'order_details:read', 'order:write', 'order_product_queue:read', 'order_product_queue:write'])] |
|
73
|
|
|
private $queue; |
|
74
|
|
|
|
|
75
|
|
|
public function __construct() |
|
76
|
|
|
{ |
|
77
|
|
|
$this->registerTime = new DateTime('now'); |
|
78
|
|
|
$this->updateTime = new DateTime('now'); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function getId() |
|
82
|
|
|
{ |
|
83
|
|
|
return $this->id; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
public function setId($id): self |
|
87
|
|
|
{ |
|
88
|
|
|
$this->id = $id; |
|
89
|
|
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function getPriority() |
|
93
|
|
|
{ |
|
94
|
|
|
return $this->priority; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function setPriority($priority): self |
|
98
|
|
|
{ |
|
99
|
|
|
$this->priority = $priority; |
|
100
|
|
|
return $this; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function getRegisterTime() |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->registerTime; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function setRegisterTime($registerTime): self |
|
109
|
|
|
{ |
|
110
|
|
|
$this->registerTime = $registerTime; |
|
111
|
|
|
return $this; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
public function getUpdateTime() |
|
115
|
|
|
{ |
|
116
|
|
|
return $this->updateTime; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
public function setUpdateTime($updateTime): self |
|
120
|
|
|
{ |
|
121
|
|
|
$this->updateTime = $updateTime; |
|
122
|
|
|
return $this; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
public function getStatus() |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->status; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function setStatus($status): self |
|
131
|
|
|
{ |
|
132
|
|
|
$this->status = $status; |
|
133
|
|
|
return $this; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
public function getQueue() |
|
137
|
|
|
{ |
|
138
|
|
|
return $this->queue; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
public function setQueue($queue): self |
|
142
|
|
|
{ |
|
143
|
|
|
$this->queue = $queue; |
|
144
|
|
|
return $this; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function getOrderProduct() |
|
148
|
|
|
{ |
|
149
|
|
|
return $this->order_product; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
public function setOrderProduct($order_product): self |
|
153
|
|
|
{ |
|
154
|
|
|
$this->order_product = $order_product; |
|
155
|
|
|
return $this; |
|
156
|
|
|
} |
|
157
|
|
|
} |
|
158
|
|
|
|
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