Passed
Push — master ( e7bca9...e1d0b8 )
by Luiz Kim
04:14 queued 02:01
created

DisplayQueue::setId()   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
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Doctrine\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...
6
use ApiPlatform\Metadata\ApiFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\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...
7
use ApiPlatform\Metadata\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\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 ApiPlatform\Metadata\Delete;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Delete 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\Metadata\Get;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Get 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\Metadata\GetCollection;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\GetCollection 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\Metadata\Put;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Put 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 ControleOnline\Listener\LogListener;
0 ignored issues
show
Bug introduced by
The type ControleOnline\Listener\LogListener 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 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...
14
use Symfony\Component\Serializer\Attribute\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Attribute\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...
15
16
#[ApiResource(
17
    operations: [
18
        new Get(security: 'is_granted(\'ROLE_CLIENT\')'),
19
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')'),
20
        new Put(security: 'is_granted(\'ROLE_CLIENT\')'),
21
        new Delete(security: 'is_granted(\'ROLE_CLIENT\')')
22
    ],
23
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
24
    normalizationContext: ['groups' => ['display_queue:read']],
25
    denormalizationContext: ['groups' => ['display_queue:write']]
26
)]
27
#[ApiFilter(filterClass: SearchFilter::class, properties: ['display' => 'exact', 'queue' => 'exact'])]
28
#[ORM\Table(name: 'display_queue')]
29
#[ORM\Index(name: 'queue_id', columns: ['queue_id'])]
30
#[ORM\Index(name: 'IDX_7EAD648851A2DF33', columns: ['display_id'])]
31
#[ORM\UniqueConstraint(name: 'display_id', columns: ['display_id', 'queue_id'])]
32
#[ORM\EntityListeners([LogListener::class])]
33
#[ORM\Entity]
34
class DisplayQueue
35
{
36
    #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
37
    #[ORM\Id]
38
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
39
    #[Groups(['order:read', 'order_details:read', 'order:write', 'display_queue:read', 'display_queue:write'])]
40
    private int $id;
41
42
    #[ORM\JoinColumn(name: 'display_id', referencedColumnName: 'id')]
43
    #[ORM\ManyToOne(targetEntity: Display::class)]
44
    #[Groups(['order:read', 'order_details:read', 'order:write', 'display_queue:read', 'display_queue:write'])]
45
    private Display $display;
46
47
    #[ORM\JoinColumn(name: 'queue_id', referencedColumnName: 'id')]
48
    #[ORM\ManyToOne(targetEntity: Queue::class)]
49
    #[Groups(['order:read', 'order_details:read', 'order:write', 'display_queue:read', 'display_queue:write'])]
50
    private Queue $queue;
51
52
    public function getId(): int
53
    {
54
        return $this->id;
55
    }
56
57
    public function getDisplay(): Display
58
    {
59
        return $this->display;
60
    }
61
62
    public function setDisplay(Display $display): self
63
    {
64
        $this->display = $display;
65
        return $this;
66
    }
67
68
    public function getQueue(): Queue
69
    {
70
        return $this->queue;
71
    }
72
73
    public function setQueue(Queue $queue): self
74
    {
75
        $this->queue = $queue;
76
        return $this;
77
    }
78
}