Passed
Push — master ( 8b264c...5280b1 )
by Luiz Kim
05:59 queued 03:53
created

Queue::setCompany()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
6
7
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...
8
9
10
11
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...
12
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...
13
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...
14
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...
15
16
17
/**
18
 * @ORM\EntityListeners({ControleOnline\Listener\LogListener::class})
19
 * @ApiResource(
20
 *     attributes={
21
 *          "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"}},
22
 *          "access_control"="is_granted('ROLE_CLIENT')"
23
 *     }, 
24
 *     normalizationContext  ={"groups"={"queue:read"}},
25
 *     denormalizationContext={"groups"={"queue:write"}},
26
 *     attributes            ={"access_control"="is_granted('ROLE_CLIENT')"},
27
 *     collectionOperations  ={
28
 *          "get"              ={
29
 *            "access_control"="is_granted('ROLE_CLIENT')", 
30
 *          },
31
 *     },
32
 *     itemOperations        ={
33
 *         "get"           ={
34
 *           "access_control"="is_granted('ROLE_CLIENT')", 
35
 *         },
36
 *         "put"           ={
37
 *           "access_control"="is_granted('ROLE_CLIENT')",  
38
 *         },
39
 *         "delete"           ={
40
 *           "access_control"="is_granted('ROLE_CLIENT')",  
41
 *         }, 
42
 *     }
43
 * )
44
 * @ORM\Table(name="queue", uniqueConstraints={@ORM\UniqueConstraint(name="queue", columns={"queue", "company_id"})}, indexes={@ORM\Index(name="company_id", columns={"company_id"})})
45
 * @ORM\Entity
46
 */
47
48
49
class Queue
50
{
51
    /**
52
     * @var int
53
     *
54
     * @ORM\Column(name="id", type="integer", nullable=false)
55
     * @ORM\Id
56
     * @ORM\GeneratedValue(strategy="IDENTITY")
57
     * @Groups({"product_category:read","order_product_queue:read","product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","queue:read", "queue:write"})   
58
     */
59
    private $id;
60
61
    /**
62
     * @var string
63
     *
64
     * @ORM\Column(name="queue", type="string", length=50, nullable=false)
65
     * @Groups({"product_category:read","order_product_queue:read","product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","queue:read", "queue:write"})   
66
     */
67
    private $queue;
68
69
    /**
70
     * @var \People
0 ignored issues
show
Bug introduced by
The type People 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...
71
     *
72
     * @ORM\ManyToOne(targetEntity="People")
73
     * @ORM\JoinColumns({
74
     *   @ORM\JoinColumn(name="company_id", referencedColumnName="id")
75
     * })
76
     * @Groups({"product_category:read","order_product_queue:read","product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","queue:read", "queue:write"})   
77
     */
78
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])]
79
80
    private $company;
81
82
83
    /**
84
     * @var \Doctrine\Common\Collections\Collection
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\Collection 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...
85
     *
86
     * @ORM\OneToMany(targetEntity="ControleOnline\Entity\OrderProductQueue", mappedBy="queue")
87
     */
88
    private $orderProductQueue;
89
90
91
    /**
92
     * @var \Doctrine\Common\Collections\Collection
93
     *
94
     * @ORM\OneToMany(targetEntity="ControleOnline\Entity\DisplayQueue", mappedBy="queue")     
95
     */
96
    private $displayQueue;
97
98
99
    /**
100
     * Get the value of id
101
     */
102
    public function getId()
103
    {
104
        return $this->id;
105
    }
106
107
    /**
108
     * Set the value of id
109
     */
110
    public function setId($id): self
111
    {
112
        $this->id = $id;
113
114
        return $this;
115
    }
116
117
    /**
118
     * Get the value of queue
119
     */
120
    public function getQueue()
121
    {
122
        return $this->queue;
123
    }
124
125
    /**
126
     * Set the value of queue
127
     */
128
    public function setQueue($queue): self
129
    {
130
        $this->queue = $queue;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Get the value of company
137
     */
138
    public function getCompany()
139
    {
140
        return $this->company;
141
    }
142
143
    /**
144
     * Set the value of company
145
     */
146
    public function setCompany($company): self
147
    {
148
        $this->company = $company;
149
150
        return $this;
151
    }
152
153
154
155
    /**
156
     * Add OrderProductQueue
157
     *
158
     * @param \ControleOnline\Entity\OrderProductQueue $invoice_tax
159
     * @return Order
160
     */
161
    public function addAOrderProductQueue(\ControleOnline\Entity\OrderProductQueue $orderProductQueue)
162
    {
163
        $this->orderProductQueue[] = $orderProductQueue;
164
165
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type ControleOnline\Entity\Queue which is incompatible with the documented return type ControleOnline\Entity\Order.
Loading history...
166
    }
167
168
    /**
169
     * Remove OrderProductQueue
170
     *
171
     * @param \ControleOnline\Entity\OrderProductQueue $invoice_tax
172
     */
173
    public function removeOrderProductQueue(\ControleOnline\Entity\OrderProductQueue $orderProductQueue)
174
    {
175
        $this->orderProductQueue->removeElement($orderProductQueue);
176
    }
177
178
    /**
179
     * Get OrderProductQueue
180
     *
181
     * @return \Doctrine\Common\Collections\Collection
182
     */
183
    public function getOrderProductQueue()
184
    {
185
        return $this->orderProductQueue;
186
    }
187
188
189
    /**
190
     * Add DisplayQueue
191
     *
192
     * @param \ControleOnline\Entity\DisplayQueue $invoice_tax
193
     * @return Order
194
     */
195
    public function addADisplayQueue(\ControleOnline\Entity\DisplayQueue $displayQueue)
196
    {
197
        $this->displayQueue[] = $displayQueue;
198
199
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type ControleOnline\Entity\Queue which is incompatible with the documented return type ControleOnline\Entity\Order.
Loading history...
200
    }
201
202
    /**
203
     * Remove DisplayQueue
204
     *
205
     * @param \ControleOnline\Entity\DisplayQueue $invoice_tax
206
     */
207
    public function removeDisplayQueue(\ControleOnline\Entity\DisplayQueue $displayQueue)
208
    {
209
        $this->displayQueue->removeElement($displayQueue);
210
    }
211
212
    /**
213
     * Get DisplayQueue
214
     *
215
     * @return \Doctrine\Common\Collections\Collection
216
     */
217
    public function getDisplayQueue()
218
    {
219
        return $this->displayQueue;
220
    }
221
}
222