Passed
Push — master ( ff11da...1e5fc5 )
by Luiz Kim
04:38 queued 02:12
created

Notification::getRead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 1
c 3
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace ControleOnline\Entity;
5
6
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...
7
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...
8
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...
9
use ApiPlatform\Metadata\ApiProperty;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiProperty 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\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...
11
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...
12
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection 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 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...
14
use App\Filter\OrderEntityFilter;
0 ignored issues
show
Bug introduced by
The type App\Filter\OrderEntityFilter 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
use ControleOnline\Entity\Order;
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\Order 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...
16
use stdClass;
17
18
/**
19
 * Module
20
 *
21
 * @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class})
22
 * @ORM\Table (name="notification", indexes={@ORM\Index (name="people_id", columns={"people_id"})})
23
 * @ORM\Entity
24
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\NotificationRepository")
25
 */
26
#[ApiResource(
27
    operations: [
28
        new Get(security: 'is_granted(\'ROLE_ADMIN\') or (is_granted(\'ROLE_CLIENT\') and previous_object.canAccess(user))'),
29
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')
30
    ],
31
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
32
    normalizationContext: ['groups' => ['notifications_read']],
33
    denormalizationContext: ['groups' => ['notifications_write']]
34
)]
35
class Notification
36
{
37
    /**
38
     * @var int
39
     *
40
     * @ORM\Column(name="id", type="integer", nullable=false)
41
     * @ORM\Id
42
     * @ORM\GeneratedValue(strategy="IDENTITY")
43
     * @Groups({"notifications_read"}) 
44
     */
45
    private $id;
46
    /**
47
     * @var string
48
     *
49
     * @ORM\Column(name="notification", type="text", length=65535, nullable=false)
50
     * @Groups({"notifications_read"})  
51
     */
52
    private $notification;
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(name="route", type="string", length=50, nullable=false)
57
     * @Groups({"notifications_read"})  
58
     */
59
    private $route;
60
    /**
61
     * @var int
62
     *
63
     * @ORM\Column(name="route_id", type="integer", nullable=false)
64
     * @Groups({"notifications_read"})  
65
     */
66
    private $routeId;
67
    /**
68
     * @var bool
69
     *
70
     * @ORM\Column(name="read", type="boolean", nullable=false)
71
     * @Groups({"notifications_read"})  
72
     */
73
    private $read;
74
    /**
75
     * @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...
76
     *
77
     * @ORM\ManyToOne(targetEntity="People")
78
     * @ORM\JoinColumns({
79
     *   @ORM\JoinColumn(name="people_id", referencedColumnName="id")
80
     * })
81
     * @Groups({"notifications_read"})  
82
     */
83
    private $people;
84
    /**
85
     * Get the value of color
86
     */
87
    public function getId()
88
    {
89
        return $this->id;
90
    }
91
    /**
92
     * Set the value of name
93
     */
94
    public function setNotification($notification): self
95
    {
96
        $this->notification = $notification;
97
        return $this;
98
    }
99
    /**
100
     * Get the value of color
101
     */
102
    public function getNotification()
103
    {
104
        return $this->notification;
105
    }
106
    /**
107
     * Set the value of name
108
     */
109
    public function setRoute($route): self
110
    {
111
        $this->route = $route;
112
        return $this;
113
    }
114
    /**
115
     * Get the value of color
116
     */
117
    public function getRoute()
118
    {
119
        return $this->route;
120
    }
121
    /**
122
     * Set the value of name
123
     */
124
    public function setRouteId($routeId): self
125
    {
126
        $this->routeId = $routeId;
127
        return $this;
128
    }
129
    /**
130
     * Get the value of color
131
     */
132
    public function getRouteId()
133
    {
134
        return $this->routeId;
135
    }
136
    /**
137
     * Set the value of name
138
     */
139
    public function setRead($read): self
140
    {
141
        $this->read = $read;
142
        return $this;
143
    }
144
    /**
145
     * Get the value of color
146
     */
147
    public function getRead()
148
    {
149
        return $this->read;
150
    }
151
    /**
152
     * Set the value of name
153
     */
154
    public function setPeople($people): self
155
    {
156
        $this->people = $people;
157
        return $this;
158
    }
159
    /**
160
     * Get the value of color
161
     */
162
    public function getPeople()
163
    {
164
        return $this->people;
165
    }
166
}
167