Passed
Push — dev ( 12e9d6...f3475b )
by Nico
35:27
created

LocationMining::setCommodityId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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\LocationMiningRepository;
15
16
#[Table(name: 'stu_location_mining')]
17
#[Entity(repositoryClass: LocationMiningRepository::class)]
18
class LocationMining implements LocationMiningInterface
19
{
20
    #[Id]
21
    #[Column(type: 'integer')]
22
    #[GeneratedValue(strategy: 'IDENTITY')]
23
    private int $id;
24
25
    #[Column(type: 'integer')]
26
    private int $location_id;
27
28
    #[Column(type: 'integer')]
29
    private int $commodity_id;
30
31
    #[Column(type: 'integer')]
32
    private int $actual_amount;
33
34
    #[Column(type: 'integer')]
35
    private int $max_amount;
36
37
    #[Column(type: 'integer', nullable: true)]
38
    private ?int $depleted_at = null;
39
40
    #[ManyToOne(targetEntity: Location::class)]
41
    #[JoinColumn(name: 'location_id', referencedColumnName: 'id')]
42
    private LocationInterface $location;
43
44
    #[ManyToOne(targetEntity: Commodity::class)]
45
    #[JoinColumn(name: 'commodity_id', referencedColumnName: 'id')]
46
    private CommodityInterface $commodity;
47
48
    public function getId(): int
49
    {
50
        return $this->id;
51
    }
52
53
    public function getLocationId(): int
54
    {
55
        return $this->location_id;
56
    }
57
58
    public function setLocationId(int $location_id): void
59
    {
60
        $this->location_id = $location_id;
61
    }
62
63
    public function getCommodityId(): int
64
    {
65
        return $this->commodity_id;
66
    }
67
68
    public function setCommodityId(int $commodity_id): void
69
    {
70
        $this->commodity_id = $commodity_id;
71
    }
72
73
    public function getActualAmount(): int
74
    {
75
        return $this->actual_amount;
76
    }
77
78
    public function setActualAmount(int $actual_amount): void
79
    {
80
        $this->actual_amount = $actual_amount;
81
    }
82
83
    public function getMaxAmount(): int
84
    {
85
        return $this->max_amount;
86
    }
87
88
    public function setMaxAmount(int $max_amount): void
89
    {
90
        $this->max_amount = $max_amount;
91
    }
92
93
    public function getDepletedAt(): ?int
94
    {
95
        return $this->depleted_at;
96
    }
97
98
    public function setDepletedAt(?int $depleted_at): void
99
    {
100
        $this->depleted_at = $depleted_at;
101
    }
102
103
    public function getLocation(): LocationInterface
104
    {
105
        return $this->location;
106
    }
107
108
    public function setLocation(LocationInterface $location): void
109
    {
110
        $this->location = $location;
111
    }
112
113
    public function getCommodity(): CommodityInterface
114
    {
115
        return $this->commodity;
116
    }
117
118
    public function setCommodity(CommodityInterface $commodity): void
119
    {
120
        $this->commodity = $commodity;
121
    }
122
}
123