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 Stu\Orm\Repository\KnPostToPlotApplicationRepository; |
15
|
|
|
|
16
|
|
|
#[Table(name: 'stu_kn_plot_application')] |
17
|
|
|
#[Entity(repositoryClass: KnPostToPlotApplicationRepository::class)] |
18
|
|
|
class KnPostToPlotApplication |
19
|
|
|
{ |
20
|
|
|
#[Id] |
21
|
|
|
#[Column(type: 'integer')] |
22
|
|
|
#[GeneratedValue(strategy: 'IDENTITY')] |
23
|
|
|
private int $id; |
24
|
|
|
|
25
|
|
|
#[Column(type: 'integer')] |
26
|
|
|
private int $post_id = 0; |
|
|
|
|
27
|
|
|
|
28
|
|
|
#[Column(type: 'integer')] |
29
|
|
|
private int $plot_id = 0; |
|
|
|
|
30
|
|
|
|
31
|
|
|
#[Column(type: 'integer')] |
32
|
|
|
private int $time = 0; |
33
|
|
|
|
34
|
|
|
#[ManyToOne(targetEntity: KnPost::class)] |
35
|
|
|
#[JoinColumn(name: 'post_id', nullable: false, referencedColumnName: 'id', onDelete: 'CASCADE')] |
36
|
|
|
private KnPost $knPost; |
37
|
|
|
|
38
|
|
|
#[ManyToOne(targetEntity: RpgPlot::class)] |
39
|
|
|
#[JoinColumn(name: 'plot_id', nullable: false, referencedColumnName: 'id', onDelete: 'CASCADE')] |
40
|
|
|
private RpgPlot $rpgPlot; |
41
|
|
|
|
42
|
|
|
public function getId(): int |
43
|
|
|
{ |
44
|
|
|
return $this->id; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function getRpgPlot(): RpgPlot |
48
|
|
|
{ |
49
|
|
|
return $this->rpgPlot; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function setRpgPlot(RpgPlot $rpgPlot): KnPostToPlotApplication |
53
|
|
|
{ |
54
|
|
|
$this->rpgPlot = $rpgPlot; |
55
|
|
|
|
56
|
|
|
return $this; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getKnPost(): KnPost |
60
|
|
|
{ |
61
|
|
|
return $this->knPost; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function setKnPost(KnPost $knPost): KnPostToPlotApplication |
65
|
|
|
{ |
66
|
|
|
$this->knPost = $knPost; |
67
|
|
|
|
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function getTime(): int |
72
|
|
|
{ |
73
|
|
|
return $this->time; |
74
|
|
|
} |
75
|
|
|
public function setTime(int $time): KnPostToPlotApplication |
76
|
|
|
{ |
77
|
|
|
$this->time = $time; |
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|