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
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @Entity(repositoryClass="Stu\Orm\Repository\RpgPlotMemberArchivRepository") |
18
|
|
|
* @Table( |
19
|
|
|
* name="stu_plots_members_archiv", |
20
|
|
|
* uniqueConstraints={@UniqueConstraint(name="plot_archiv_user_idx", columns={"plot_id", "user_id"})} |
21
|
|
|
* ) |
22
|
|
|
*/ |
23
|
|
|
class RpgPlotMemberArchiv implements RpgPlotMemberArchivInterface |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* @Id |
27
|
|
|
* @Column(type="integer") |
28
|
|
|
* @GeneratedValue(strategy="IDENTITY") |
29
|
|
|
* |
30
|
|
|
*/ |
31
|
|
|
private int $id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @Column(type="string", nullable=true) |
35
|
|
|
* |
36
|
|
|
*/ |
37
|
|
|
private ?string $version = ''; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @Column(type="integer", nullable=true) |
41
|
|
|
* |
42
|
|
|
*/ |
43
|
|
|
private ?int $former_id = 0; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @Column(type="integer", nullable=true) |
47
|
|
|
* |
48
|
|
|
*/ |
49
|
|
|
private ?int $plot_id = 0; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @Column(type="integer", nullable=true) |
53
|
|
|
* |
54
|
|
|
*/ |
55
|
|
|
private ?int $user_id = 0; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* |
59
|
|
|
* @ManyToOne(targetEntity="RpgPlotArchiv", inversedBy="members") |
60
|
|
|
* @JoinColumn(name="plot_id", referencedColumnName="id", onDelete="CASCADE") |
61
|
|
|
*/ |
62
|
|
|
private RpgPlotArchivInterface $rpgPlot; |
63
|
|
|
|
64
|
|
|
public function getId(): int |
65
|
|
|
{ |
66
|
|
|
return $this->id; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getVersion(): ?string |
70
|
|
|
{ |
71
|
|
|
return $this->version; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function getFormerId(): int |
75
|
|
|
{ |
76
|
|
|
return $this->former_id; |
|
|
|
|
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function getPlotId(): int |
80
|
|
|
{ |
81
|
|
|
return $this->plot_id; |
|
|
|
|
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function getUserId(): int |
85
|
|
|
{ |
86
|
|
|
return $this->user_id; |
|
|
|
|
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getRpgPlot(): RpgPlotArchivInterface |
90
|
|
|
{ |
91
|
|
|
return $this->rpgPlot; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setRpgPlot(RpgPlotArchivInterface $rpgPlot): RpgPlotMemberArchivInterface |
95
|
|
|
{ |
96
|
|
|
$this->rpgPlot = $rpgPlot; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|