Passed
Push — master ( 27fd8a...0e6745 )
by Luiz Kim
10:23 queued 02:06
created

ExtraData::getId()   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\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...
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\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...
9
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...
10
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...
11
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...
12
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...
13
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...
14
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...
15
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...
16
17
/**
18
 * @ORM\EntityListeners ({ControleOnline\Listener\LogListener::class})
19
 * @ORM\Table (name="extra_data")
20
 * @ORM\Entity (repositoryClass="ControleOnline\Repository\ExtraDataRepository")
21
 */
22
#[ApiResource(
23
    operations: [
24
        new Get(uriTemplate: '/extra_data/{id}', security: 'is_granted(\'ROLE_CLIENT\')'),
25
        new GetCollection(uriTemplate: '/extra_data', security: 'is_granted(\'ROLE_CLIENT\')'),
26
        new Put(
27
            uriTemplate: '/extra_data/{id}',
28
            security: 'is_granted(\'ROLE_ADMIN\') or (is_granted(\'ROLE_CLIENT\'))',
29
            validationContext: ['groups' => ['extra_data_write']],
30
            denormalizationContext: ['groups' => ['extra_data_write']]
31
        ),
32
        new Delete(uriTemplate: '/extra_data/{id}', security: 'is_granted(\'ROLE_CLIENT\')'),
33
        new Post(uriTemplate: '/extra_data', securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'),
34
    ],
35
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' =>
36
    ['text/csv']],
37
    normalizationContext: ['groups' => ['extra_data_read']],
38
    denormalizationContext: ['groups' => ['extra_data_write']]
39
)]
40
#[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact', 'type' => 'exact', 'people' => 'exact'])]
41
42
class ExtraData
43
{
44
    /**
45
     * @var integer
46
     *
47
     * @ORM\Column(name="id", type="integer", nullable=false)
48
     * @ORM\Id
49
     * @Groups({"extrafields_read", "extra_data_read"})
50
     * @ORM\GeneratedValue(strategy="IDENTITY")
51
     */
52
    private $id;
53
    /**
54
     * @var \ControleOnline\Entity\ExtraFields
55
     *
56
     * @ORM\ManyToOne(targetEntity="ControleOnline\Entity\ExtraFields")
57
     * @ORM\JoinColumns({
58
     *   @ORM\JoinColumn(name="extra_fields_id", referencedColumnName="id")
59
     * })
60
     * @Groups({"extra_data_read"})
61
     */
62
    private $extra_fields;
63
64
    /**
65
     * @ORM\Column(name="entity_id", type="string", nullable=false)
66
     * @Groups({"extra_data_read"})
67
     */
68
    private $entity_id;
69
70
    /**
71
     * @ORM\Column(name="entity_name", type="string", nullable=false)
72
     * @Groups({"extra_data_read"})
73
     */
74
    private $entity_name;
75
76
    /**
77
     * @ORM\Column(name="data_value", type="string", nullable=false)
78
     * @Groups({"extra_data_read"})
79
     */
80
    private $value;
81
    /**
82
     * Constructor
83
     */
84
    public function __construct()
85
    {
86
    }
87
    /**
88
     * Get id
89
     *
90
     * @return integer
91
     */
92
    public function getId()
93
    {
94
        return $this->id;
95
    }
96
97
98
    public function setValue($value): self
99
    {
100
        $this->value = $value;
101
        return $this;
102
    }
103
    public function getValue()
104
    {
105
        return $this->value;
106
    }
107
108
    /**
109
     * Get the value of entity_id
110
     */
111
    public function getEntityId()
112
    {
113
        return $this->entity_id;
114
    }
115
116
    /**
117
     * Set the value of entity_id
118
     */
119
    public function setEntityId($entity_id): self
120
    {
121
        $this->entity_id = $entity_id;
122
123
        return $this;
124
    }
125
126
    /**
127
     * Get the value of entity_name
128
     */
129
    public function getEntityName()
130
    {
131
        return $this->entity_name;
132
    }
133
134
    /**
135
     * Set the value of entity_name
136
     */
137
    public function setEntityName($entity_name): self
138
    {
139
        $this->entity_name = $entity_name;
140
141
        return $this;
142
    }
143
144
    /**
145
     * Get the value of extra_fields
146
     */
147
    public function getExtraFields()
148
    {
149
        return $this->extra_fields;
150
    }
151
152
    /**
153
     * Set the value of extra_fields
154
     */
155
    public function setExtraFields($extra_fields): self
156
    {
157
        $this->extra_fields = $extra_fields;
158
159
        return $this;
160
    }
161
}
162