Passed
Push — master ( 0695c6...577786 )
by Luiz Kim
13:50 queued 11:38
created

OrderProductQueue   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 210
Duplicated Lines 0 %

Importance

Changes 7
Bugs 0 Features 0
Metric Value
eloc 35
c 7
b 0
f 0
dl 0
loc 210
rs 10
wmc 15

15 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A getUpdateTime() 0 3 1
A setStatus() 0 5 1
A setPriority() 0 5 1
A setQueue() 0 5 1
A setRegisterTime() 0 5 1
A setUpdateTime() 0 5 1
A setOrderProduct() 0 5 1
A getRegisterTime() 0 3 1
A __construct() 0 4 1
A getQueue() 0 3 1
A getOrderProduct() 0 3 1
A getStatus() 0 3 1
A getPriority() 0 3 1
A getId() 0 3 1
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
use ApiPlatform\Core\Annotation\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\ApiResource was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\Serializer\Annotation\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Annotation\Groups was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use ApiPlatform\Core\Annotation\ApiFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Annotation\ApiFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Core\Bridge\...Orm\Filter\SearchFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use ApiPlatform\Doctrine\Orm\Filter\ExistsFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Doctrine\Orm\Filter\ExistsFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use DateTime;
13
14
/**
15
 * @ORM\EntityListeners({ControleOnline\Listener\LogListener::class})
16
 * @ApiResource(
17
 *     attributes={
18
 *          "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"}},
19
 *          "access_control"="is_granted('ROLE_CLIENT')"
20
 *     }, 
21
 *     normalizationContext  ={"groups"={"order_product_queue:read"}},
22
 *     denormalizationContext={"groups"={"order_product_queue:write"}},
23
 *     attributes            ={"access_control"="is_granted('ROLE_CLIENT')"},
24
 *     collectionOperations  ={
25
 *          "get"              ={
26
 *            "access_control"="is_granted('ROLE_CLIENT')", 
27
 *          },
28
 *     },
29
 *     itemOperations        ={
30
 *         "get"           ={
31
 *           "access_control"="is_granted('ROLE_CLIENT')", 
32
 *         },
33
 *         "put"           ={
34
 *           "access_control"="is_granted('ROLE_CLIENT')",  
35
 *         },
36
 *         "delete"           ={
37
 *           "access_control"="is_granted('ROLE_CLIENT')",  
38
 *         }, 
39
 *     }
40
 * )
41
 * @ORM\Table(name="order_product_queue", indexes={@ORM\Index(name="status_id", columns={"status_id"}), @ORM\Index(name="queue_id", columns={"queue_id"}), @ORM\Index(name="people_id", columns={"order_id"})})
42
 * @ORM\Entity
43
 */
44
45
46
class OrderProductQueue
47
{
48
    /**
49
     * @var int
50
     *
51
     * @ORM\Column(name="id", type="integer", nullable=false)
52
     * @ORM\Id
53
     * @ORM\GeneratedValue(strategy="IDENTITY")
54
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"}) 
55
     */
56
    private $id;
57
58
    /**
59
     * @var string
60
     *
61
     * @ORM\Column(name="priority", type="string", length=0, nullable=false)
62
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"})  
63
     */
64
    private $priority;
65
66
    /**
67
     * @var \DateTime
68
     *
69
     * @ORM\Column(name="register_time", type="datetime", nullable=false, options={"default"="current_timestamp()"})
70
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"})   
71
     */
72
    private $registerTime;
73
74
    /**
75
     * @var \DateTime
76
     *
77
     * @ORM\Column(name="update_time", type="datetime", nullable=false, options={"default"="current_timestamp()"})
78
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"})  
79
     */
80
    private $updateTime;
81
82
    /**
83
     * @var OrderProduct
84
     *
85
     * @ORM\ManyToOne(targetEntity="OrderProduct")
86
     * @ORM\JoinColumns({
87
     *   @ORM\JoinColumn(name="order_product_id", referencedColumnName="id")
88
     * })
89
     * @Groups({"order_product_queue:read", "order_product_queue:write"})  
90
     */
91
    #[ApiFilter(ExistsFilter::class, properties: ['order_product.parentProduct'])]
92
93
    private $order_product;
94
95
    /**
96
     * @var ControleOnline\Entity\Status
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\ControleOnline\Entity\Status was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
97
     *
98
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Status")
99
     * @ORM\JoinColumns({
100
     *   @ORM\JoinColumn(name="status_id", referencedColumnName="id")
101
     * })
102
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"})  
103
     */
104
105
106
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['orderQueue.status.realStatus' => 'exact'])]
107
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['status' => 'exact'])]
108
109
    private $status;
110
111
    /**
112
     * @var \Queue
0 ignored issues
show
Bug introduced by
The type Queue was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
113
     *
114
     * @ORM\ManyToOne(targetEntity="Queue")
115
     * @ORM\JoinColumns({
116
     *   @ORM\JoinColumn(name="queue_id", referencedColumnName="id")
117
     * })
118
     * @Groups({"order:read","order_details:read","order:write","order_product_queue:read", "order_product_queue:write"})  
119
     */
120
121
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['queue' => 'exact'])]
122
123
    private $queue;
124
125
126
    public function __construct()
127
    {
128
        $this->registerTime = new DateTime('now');
129
        $this->updateTime = new DateTime('now');
130
    }
131
132
    /**
133
     * Get the value of id
134
     */
135
    public function getId()
136
    {
137
        return $this->id;
138
    }
139
140
    /**
141
     * Set the value of id
142
     */
143
    public function setId($id): self
144
    {
145
        $this->id = $id;
146
147
        return $this;
148
    }
149
150
    /**
151
     * Get the value of priority
152
     */
153
    public function getPriority()
154
    {
155
        return $this->priority;
156
    }
157
158
    /**
159
     * Set the value of priority
160
     */
161
    public function setPriority($priority): self
162
    {
163
        $this->priority = $priority;
164
165
        return $this;
166
    }
167
168
    /**
169
     * Get the value of registerTime
170
     */
171
    public function getRegisterTime()
172
    {
173
        return $this->registerTime;
174
    }
175
176
    /**
177
     * Set the value of registerTime
178
     */
179
    public function setRegisterTime($registerTime): self
180
    {
181
        $this->registerTime = $registerTime;
182
183
        return $this;
184
    }
185
186
    /**
187
     * Get the value of updateTime
188
     */
189
    public function getUpdateTime()
190
    {
191
        return $this->updateTime;
192
    }
193
194
    /**
195
     * Set the value of updateTime
196
     */
197
    public function setUpdateTime($updateTime): self
198
    {
199
        $this->updateTime = $updateTime;
200
201
        return $this;
202
    }
203
204
    /**
205
     * Get the value of status
206
     */
207
    public function getStatus()
208
    {
209
        return $this->status;
210
    }
211
212
    /**
213
     * Set the value of status
214
     */
215
    public function setStatus($status): self
216
    {
217
        $this->status = $status;
218
219
        return $this;
220
    }
221
222
    /**
223
     * Get the value of queue
224
     */
225
    public function getQueue()
226
    {
227
        return $this->queue;
228
    }
229
230
    /**
231
     * Set the value of queue
232
     */
233
    public function setQueue($queue): self
234
    {
235
        $this->queue = $queue;
236
237
        return $this;
238
    }
239
240
    /**
241
     * Get the value of order_product
242
     */
243
    public function getOrderProduct()
244
    {
245
        return $this->order_product;
246
    }
247
248
    /**
249
     * Set the value of order_product
250
     */
251
    public function setOrderProduct($order_product): self
252
    {
253
        $this->order_product = $order_product;
254
255
        return $this;
256
    }
257
}
258