Passed
Push — master ( 5c1693...35d424 )
by Luiz Kim
02:24
created

Model::getModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
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...
6
use ApiPlatform\Metadata\Post;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Post 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\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...
8
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...
9
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...
10
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...
11
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...
12
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...
13
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...
14
use DateTime;
15
use 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...
16
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...
17
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...
18
19
/**
20
 * @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class})
21
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\ModelRepository")
22
 */
23
#[ApiResource(
24
    operations: [
25
        new Get(
26
            security: 'is_granted(\'ROLE_CLIENT\')',
27
        ),
28
        new Put(
29
            security: 'is_granted(\'ROLE_CLIENT\')'
30
        ),
31
        new Post(
32
            security: 'is_granted(\'ROLE_CLIENT\')'
33
        ),
34
        new Delete(
35
            security: 'is_granted(\'ROLE_CLIENT\')'
36
        ),
37
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')
38
    ],
39
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
40
    normalizationContext: ['groups' => ['model_read']],
41
    denormalizationContext: ['groups' => ['model_write']]
42
)]
43
class Model
44
{
45
    /**
46
     * @ORM\Column(type="integer", nullable=false)
47
     * @ORM\Id
48
     * @ORM\GeneratedValue(strategy="IDENTITY")
49
     * @Groups({ "contract_read","model_read"})
50
     */
51
    private $id;
52
53
    /**
54
     * @var \ControleOnline\Entity\Category
55
     *
56
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\Category")
57
     * @ORM\JoinColumns({
58
     *   @ORM\JoinColumn(name="category_id", referencedColumnName="id")
59
     * })
60
     * @Groups({"contract_read","model_read","model_write"})
61
     */
62
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['category' => 'exact'])]
63
64
    private $category;
65
    /**
66
     * @var \ControleOnline\Entity\People
0 ignored issues
show
Bug introduced by
The type ControleOnline\Entity\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...
67
     *
68
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People")
69
     * @ORM\JoinColumns({
70
     *   @ORM\JoinColumn(name="people_id", referencedColumnName="id")
71
     * })
72
     * @Groups({"contract_read","model_read","model_write"})
73
     */
74
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['people' => 'exact'])]
75
76
    private $people;
77
78
79
    /**
80
     * @var \ControleOnline\Entity\People
81
     *
82
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\People")
83
     * @ORM\JoinColumns({
84
     *   @ORM\JoinColumn(name="signer_id", referencedColumnName="id")
85
     * })
86
     * @Groups({"contract_read","model_read","model_write"})
87
     */
88
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['signer' => 'exact'])]
89
90
    private $signer;
91
92
    /**
93
     * @var \ControleOnline\Entity\File
94
     *
95
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\File")
96
     * @ORM\JoinColumns({
97
     *   @ORM\JoinColumn(name="file_id", referencedColumnName="id")
98
     * })
99
     * @Groups({"model_detail_read","model_read","model_write"})
100
     */
101
    private $file;
102
103
    /**
104
     * @ORM\Column(name="context", type="string")
105
     * @Groups({"contract_read","model_read","model_write"})
106
     */
107
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['context' => 'exact'])]
108
    private $context;
109
110
    /**
111
     * @ORM\Column(name="model", type="string")
112
     * @Groups({"contract_read","model_read","model_write"})
113
     */
114
    #[ApiFilter(filterClass: SearchFilter::class, properties: ['model' => 'partial'])]
115
    private $model;
116
117
118
    public function getId(): int
119
    {
120
        return $this->id;
121
    }
122
123
124
125
    /**
126
     * Get the value of people
127
     */
128
    public function getPeople(): \ControleOnline\Entity\People
129
    {
130
        return $this->people;
131
    }
132
133
    /**
134
     * Set the value of people
135
     */
136
    public function setPeople(\ControleOnline\Entity\People $people): self
137
    {
138
        $this->people = $people;
139
140
        return $this;
141
    }
142
143
    /**
144
     * Get the value of category
145
     */
146
    public function getCategory()
147
    {
148
        return $this->category;
149
    }
150
151
    /**
152
     * Set the value of category
153
     */
154
    public function setCategory($category): self
155
    {
156
        $this->category = $category;
157
158
        return $this;
159
    }
160
161
162
163
    /**
164
     * Get the value of model
165
     */
166
    public function getModel()
167
    {
168
        return $this->model;
169
    }
170
171
    /**
172
     * Set the value of model
173
     */
174
    public function setModel($model): self
175
    {
176
        $this->model = $model;
177
178
        return $this;
179
    }
180
181
    /**
182
     * Get the value of context
183
     */
184
    public function getContext()
185
    {
186
        return $this->context;
187
    }
188
189
    /**
190
     * Set the value of context
191
     */
192
    public function setContext($context): self
193
    {
194
        $this->context = $context;
195
196
        return $this;
197
    }
198
199
    /**
200
     * Get the value of signer
201
     */
202
    public function getSigner()
203
    {
204
        return $this->signer;
205
    }
206
207
    /**
208
     * Set the value of signer
209
     */
210
    public function setSigner($signer): self
211
    {
212
        $this->signer = $signer;
213
214
        return $this;
215
    }
216
217
    /**
218
     * Get the value of file
219
     */
220
    public function getFile(): \ControleOnline\Entity\File
221
    {
222
        return $this->file;
223
    }
224
225
    /**
226
     * Set the value of file
227
     */
228
    public function setFile(\ControleOnline\Entity\File $file): self
229
    {
230
        $this->file = $file;
231
232
        return $this;
233
    }
234
}
235