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