Passed
Push — dev ( f10869...6b4369 )
by Janko
12:04
created

KnCommentArchiv::getVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
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\JoinColumn;
12
use Doctrine\ORM\Mapping\ManyToOne;
13
use Doctrine\ORM\Mapping\Table;
14
use Doctrine\ORM\Mapping\UniqueConstraint;
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\KnCommentArchivRepository;
17
18
#[Table(name: 'stu_kn_comments_archiv')]
19
#[UniqueConstraint(name: 'unique_comments_former_id', columns: ['former_id'])]
20
#[Entity(repositoryClass: KnCommentArchivRepository::class)]
21
class KnCommentArchiv implements KnCommentArchivInterface
22
{
23
    #[Id]
24
    #[Column(type: 'integer')]
25
    #[GeneratedValue(strategy: 'IDENTITY')]
26
    private int $id;
27
28
    #[Column(type: 'string')]
29
    private string $version = '';
30
31
    #[Column(type: 'integer')]
32
    private int $former_id = 0;
33
34
    #[Column(type: 'integer')]
35
    private int $post_id = 0;
36
37
    #[Column(type: 'integer')]
38
    private int $user_id = 0;
39
40
    #[Column(type: 'string')]
41
    private string $username = '';
42
43
    #[Column(type: 'string')]
44
    private string $text = '';
45
46
    #[Column(type: 'integer')]
47
    private int $date = 0;
48
49
    #[Column(type: 'integer', nullable: true)]
50
    private ?int $deleted = null;
51
52
    #[ManyToOne(targetEntity: 'KnPostArchiv')]
53
    #[JoinColumn(name: 'post_id', referencedColumnName: 'former_id', onDelete: 'CASCADE')]
54
    private KnPostArchivInterface $post;
55
56
57
    #[Override]
58
    public function getId(): int
59
    {
60
        return $this->id;
61
    }
62
63
    #[Override]
64
    public function getVersion(): ?string
65
    {
66
        return $this->version;
67
    }
68
69
    #[Override]
70
    public function getFormerId(): int
71
    {
72
        return $this->former_id;
73
    }
74
75
    #[Override]
76
    public function getKnId(): int
77
    {
78
        return $this->post_id;
79
    }
80
81
    #[Override]
82
    public function setPostId(int $postId): KnCommentArchivInterface
83
    {
84
        $this->post_id = $postId;
85
86
        return $this;
87
    }
88
89
    #[Override]
90
    public function getUserId(): int
91
    {
92
        return $this->user_id;
93
    }
94
95
    #[Override]
96
    public function getUsername(): string
97
    {
98
        return $this->username;
99
    }
100
101
    #[Override]
102
    public function setUsername(string $username): KnCommentArchivInterface
103
    {
104
        $this->username = $username;
105
106
        return $this;
107
    }
108
109
    #[Override]
110
    public function getText(): string
111
    {
112
        return $this->text;
113
    }
114
115
    #[Override]
116
    public function setText(string $text): KnCommentArchivInterface
117
    {
118
        $this->text = $text;
119
120
        return $this;
121
    }
122
123
    #[Override]
124
    public function getDate(): int
125
    {
126
        return $this->date;
127
    }
128
129
    #[Override]
130
    public function setDate(int $date): KnCommentArchivInterface
131
    {
132
        $this->date = $date;
133
134
        return $this;
135
    }
136
137
    #[Override]
138
    public function getPosting(): KnPostArchivInterface
139
    {
140
        return $this->post;
141
    }
142
143
    #[Override]
144
    public function setPosting(KnPostArchivInterface $post): KnCommentArchivInterface
145
    {
146
        $this->post = $post;
147
148
        return $this;
149
    }
150
151
    #[Override]
152
    public function setDeleted(int $timestamp): KnCommentArchivInterface
153
    {
154
        $this->deleted = $timestamp;
155
156
        return $this;
157
    }
158
159
    #[Override]
160
    public function isDeleted(): bool
161
    {
162
        return $this->deleted !== null;
163
    }
164
}
165