Passed
Push — dev ( 5b1d95...923b08 )
by Janko
23:33 queued 07:31
created

DatabaseEntry::getObjectId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Entity;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\GeneratedValue;
10
use Doctrine\ORM\Mapping\Id;
11
use Doctrine\ORM\Mapping\Index;
12
use Doctrine\ORM\Mapping\JoinColumn;
13
use Doctrine\ORM\Mapping\ManyToOne;
14
use Doctrine\ORM\Mapping\Table;
15
use Override;
0 ignored issues
show
Bug introduced by
The type Override 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 Stu\Orm\Repository\DatabaseEntryRepository;
17
18
#[Table(name: 'stu_database_entrys')]
19
#[Index(name: 'database_entry_category_id_idx', columns: ['category_id'])]
20
#[Entity(repositoryClass: DatabaseEntryRepository::class)]
21
class DatabaseEntry implements DatabaseEntryInterface
22
{
23
    #[Id]
24
    #[Column(type: 'integer')]
25
    #[GeneratedValue(strategy: 'IDENTITY')]
26
    private int $id;
27
28
    #[Column(type: 'string')]
29
    private string $description;
30
31
    #[Column(type: 'text')]
32
    private string $data;
33
34
    #[Column(type: 'integer')]
35
    private int $category_id;
36
37
    #[Column(type: 'integer')]
38
    private int $type;
39
40
    #[Column(type: 'integer')]
41
    private int $sort;
42
43
    #[Column(type: 'integer')]
44
    private int $object_id;
45
46
    #[Column(type: 'integer', nullable: true)]
47
    private ?int $layer_id = null;
48
49
    #[ManyToOne(targetEntity: DatabaseType::class)]
50
    #[JoinColumn(name: 'type', referencedColumnName: 'id')]
51
    private DatabaseTypeInterface $type_object;
52
53
    #[ManyToOne(targetEntity: DatabaseCategory::class, inversedBy: 'entries')]
54
    #[JoinColumn(name: 'category_id', referencedColumnName: 'id')]
55
    private DatabaseCategoryInterface $category;
56
57 7
    #[Override]
58
    public function getId(): int
59
    {
60 7
        return $this->id;
61
    }
62
63
    #[Override]
64
    public function setDescription(string $description): DatabaseEntryInterface
65
    {
66
        $this->description = $description;
67
68
        return $this;
69
    }
70
71 2
    #[Override]
72
    public function getDescription(): string
73
    {
74 2
        return $this->description;
75
    }
76
77
    #[Override]
78
    public function setData(string $data): DatabaseEntryInterface
79
    {
80
        $this->data = $data;
81
82
        return $this;
83
    }
84
85 1
    #[Override]
86
    public function getData(): string
87
    {
88 1
        return $this->data;
89
    }
90
91
    #[Override]
92
    public function setCategory(DatabaseCategoryInterface $category): DatabaseEntryInterface
93
    {
94
        $this->category = $category;
95
96
        return $this;
97
    }
98
99
    #[Override]
100
    public function getCategory(): DatabaseCategoryInterface
101
    {
102
        return $this->category;
103
    }
104
105
    #[Override]
106
    public function setSort(int $sort): DatabaseEntryInterface
107
    {
108
        $this->sort = $sort;
109
110
        return $this;
111
    }
112
113
    #[Override]
114
    public function getSort(): int
115
    {
116
        return $this->sort;
117
    }
118
119
    #[Override]
120
    public function setObjectId(int $objectId): DatabaseEntryInterface
121
    {
122
        $this->object_id = $objectId;
123
124
        return $this;
125
    }
126
127 2
    #[Override]
128
    public function getObjectId(): int
129
    {
130 2
        return $this->object_id;
131
    }
132
133 1
    #[Override]
134
    public function getTypeObject(): DatabaseTypeInterface
135
    {
136 1
        return $this->type_object;
137
    }
138
139
    #[Override]
140
    public function setTypeObject(DatabaseTypeInterface $typeObject): DatabaseEntryInterface
141
    {
142
        $this->type_object = $typeObject;
143
144
        return $this;
145
    }
146
147
    #[Override]
148
    public function getCategoryId(): int
149
    {
150
        return $this->category_id;
151
    }
152
153
    #[Override]
154
    public function getTypeId(): int
155
    {
156
        return $this->type;
157
    }
158
159
    #[Override]
160
    public function getLayerId(): ?int
161
    {
162
        return $this->layer_id;
163
    }
164
165
    #[Override]
166
    public function setLayerId(?int $layerId): DatabaseEntryInterface
167
    {
168
        $this->layer_id = $layerId;
169
170
        return $this;
171
    }
172
}
173