Test Failed
Pull Request — master (#1764)
by Nico
12:03
created

Buoy::setUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Entity;
6
7
8
use Doctrine\ORM\Mapping\Column;
9
use Doctrine\ORM\Mapping\Entity;
10
use Doctrine\ORM\Mapping\GeneratedValue;
11
use Doctrine\ORM\Mapping\Id;
12
use Doctrine\ORM\Mapping\JoinColumn;
13
use Doctrine\ORM\Mapping\ManyToOne;
14
use Doctrine\ORM\Mapping\Table;
15
16
#[Table(name: 'stu_buoy')]
17
#[Entity(repositoryClass: 'Stu\Orm\Repository\BuoyRepository')]
18
class Buoy implements BuoyInterface
19
{
20
    #[Id]
21
    #[Column(type: 'integer')]
22
    #[GeneratedValue(strategy: 'IDENTITY')]
23
    private int $id;
24
25
    #[Column(type: 'integer')]
26
    private int $user_id;
27
28
    #[Column(type: 'text')]
29
    private string $text;
30
31
    #[Column(type: 'integer', nullable: true)]
32
    private ?int $map_id = null;
33
34
    #[Column(type: 'integer', nullable: true)]
35
    private ?int $sys_map_id = null;
36
37
    #[ManyToOne(targetEntity: 'Map')]
38
    #[JoinColumn(name: 'map_id', referencedColumnName: 'id')]
39
    private ?MapInterface $map = null;
40
41
    #[ManyToOne(targetEntity: 'StarSystemMap')]
42
    #[JoinColumn(name: 'sys_map_id', referencedColumnName: 'id')]
43
    private ?StarSystemMapInterface $systemMap = null;
44
45
    #[ManyToOne(targetEntity: 'User')]
46
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id')]
47
    private UserInterface $user;
48
49
    public function getId(): int
50
    {
51
        return $this->id;
52
    }
53
54
    public function getUserId(): int
55
    {
56
        return $this->user_id;
57
    }
58
59
    public function setUserId(int $user_id): void
60
    {
61
        $this->user_id = $user_id;
62
    }
63
64
    public function getText(): string
65
    {
66
        return $this->text;
67
    }
68
69
    public function setText(string $text): void
70
    {
71
        $this->text = $text;
72
    }
73
74
    public function getMapId(): ?int
75
    {
76
        return $this->map_id;
77
    }
78
79
    public function setMapId(?int $map_id): void
80
    {
81
        $this->map_id = $map_id;
82
    }
83
84
    public function getSysMapId(): ?int
85
    {
86
        return $this->sys_map_id;
87
    }
88
89
    public function setSysMapId(?int $sys_map_id): void
90
    {
91
        $this->sys_map_id = $sys_map_id;
92
    }
93
94
    public function getMap(): ?MapInterface
95
    {
96
        return $this->map;
97
    }
98
99
    public function setMap(?MapInterface $map): void
100
    {
101
        $this->map = $map;
102
    }
103
104
    public function getSystemMap(): ?StarSystemMapInterface
105
    {
106
        return $this->systemMap;
107
    }
108
109
    public function setSystemMap(?StarSystemMapInterface $systemMap): void
110
    {
111
        $this->systemMap = $systemMap;
112
    }
113
114
    public function getUser(): UserInterface
115
    {
116
        return $this->user;
117
    }
118
119
    public function setUser(UserInterface $user): void
120
    {
121
        $this->user = $user;
122
    }
123
}