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 Stu\Orm\Repository\WeaponShieldRepository; |
16
|
|
|
|
17
|
|
|
#[Table(name: 'stu_weapon_shield')] |
18
|
|
|
#[Index(name: 'weapon_shield_module_idx', columns: ['module_id'])] |
19
|
|
|
#[Index(name: 'weapon_shield_weapon_idx', columns: ['weapon_id'])] |
20
|
|
|
#[Entity(repositoryClass: WeaponShieldRepository::class)] |
21
|
|
|
class WeaponShield |
22
|
|
|
{ |
23
|
|
|
#[Id] |
24
|
|
|
#[Column(type: 'integer')] |
25
|
|
|
#[GeneratedValue(strategy: 'IDENTITY')] |
26
|
|
|
private int $id; |
27
|
|
|
|
28
|
|
|
#[Column(type: 'integer')] |
29
|
|
|
private int $module_id = 0; |
30
|
|
|
|
31
|
|
|
#[Column(type: 'integer')] |
32
|
|
|
private int $weapon_id = 0; |
33
|
|
|
|
34
|
|
|
#[Column(type: 'integer')] |
35
|
|
|
private int $modificator = 0; |
36
|
|
|
|
37
|
|
|
#[Column(type: 'integer', nullable: true)] |
38
|
|
|
private ?int $faction_id = 0; |
39
|
|
|
|
40
|
|
|
#[ManyToOne(targetEntity: Weapon::class)] |
41
|
|
|
#[JoinColumn(name: 'weapon_id', nullable: false, referencedColumnName: 'id')] |
42
|
|
|
private Weapon $weapon; |
43
|
|
|
|
44
|
|
|
#[ManyToOne(targetEntity: Module::class)] |
45
|
|
|
#[JoinColumn(name: 'module_id', nullable: false, referencedColumnName: 'id')] |
46
|
|
|
private Module $module; |
47
|
|
|
|
48
|
|
|
public function getId(): int |
49
|
|
|
{ |
50
|
|
|
return $this->id; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function getModuleId(): int |
54
|
|
|
{ |
55
|
|
|
return $this->module_id; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function setModuleId(int $moduleId): WeaponShield |
59
|
|
|
{ |
60
|
|
|
$this->module_id = $moduleId; |
61
|
|
|
|
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getWeaponId(): int |
66
|
|
|
{ |
67
|
|
|
return $this->weapon_id; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function setWeaponId(int $weaponid): WeaponShield |
71
|
|
|
{ |
72
|
|
|
$this->weapon_id = $weaponid; |
73
|
|
|
|
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function getModificator(): int |
78
|
|
|
{ |
79
|
|
|
return $this->modificator; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function setModificator(int $Modificator): WeaponShield |
83
|
|
|
{ |
84
|
|
|
$this->modificator = $Modificator; |
85
|
|
|
|
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function getFactionId(): ?int |
90
|
|
|
{ |
91
|
|
|
return $this->faction_id; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function setFactionId(int $factionid): WeaponShield |
95
|
|
|
{ |
96
|
|
|
$this->faction_id = $factionid; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function getWeapon(): Weapon |
102
|
|
|
{ |
103
|
|
|
return $this->weapon; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function getModule(): Module |
107
|
|
|
{ |
108
|
|
|
return $this->module; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|