Passed
Push — dev ( 7914d2...bbc331 )
by Janko
10:29
created

TradeLicenseInfo::getDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\TradeLicenseInfoRepository;
16
17
#[Table(name: 'stu_trade_license_info')]
18
#[Index(name: 'trade_license_info_post_idx', columns: ['posts_id'])]
19
#[Entity(repositoryClass: TradeLicenseInfoRepository::class)]
20
class TradeLicenseInfo
21
{
22
    #[Id]
23
    #[Column(type: 'integer')]
24
    #[GeneratedValue(strategy: 'IDENTITY')]
25
    private int $id;
26
27
    #[Column(type: 'integer')]
28
    private int $posts_id = 0;
29
30
    #[Column(type: 'integer')]
31
    private int $commodity_id = 0;
0 ignored issues
show
introduced by
The private property $commodity_id is not used, and could be removed.
Loading history...
32
33
    #[Column(type: 'integer')]
34
    private int $amount = 0;
35
36
    #[Column(type: 'integer')]
37
    private int $days = 0;
38
39
    #[Column(type: 'integer')]
40
    private int $date = 0;
41
42
    #[ManyToOne(targetEntity: TradePost::class)]
43
    #[JoinColumn(name: 'posts_id', nullable: false, referencedColumnName: 'id', onDelete: 'CASCADE')]
44
    private TradePost $tradePost;
45
46
    #[ManyToOne(targetEntity: Commodity::class)]
47
    #[JoinColumn(name: 'commodity_id', nullable: false, referencedColumnName: 'id', onDelete: 'CASCADE')]
48
    private Commodity $commodity;
49
50
    public function getId(): int
51
    {
52
        return $this->id;
53
    }
54
55 1
    public function getTradepost(): TradePost
56
    {
57 1
        return $this->tradePost;
58
    }
59
60
    public function setTradepost(TradePost $tradepost): TradeLicenseInfo
61
    {
62
        $this->tradePost = $tradepost;
63
64
        return $this;
65
    }
66
67
    public function getTradePostId(): int
68
    {
69
        return $this->posts_id;
70
    }
71
72
    public function setTradePostId(int $posts_id): TradeLicenseInfo
73
    {
74
        $this->posts_id = $posts_id;
75
76
        return $this;
77
    }
78
79 6
    public function getCommodity(): Commodity
80
    {
81 6
        return $this->commodity;
82
    }
83
84
    public function setCommodity(Commodity $commodity): TradeLicenseInfo
85
    {
86
        $this->commodity = $commodity;
87
88
        return $this;
89
    }
90
91 6
    public function getAmount(): int
92
    {
93 6
        return $this->amount;
94
    }
95
96
    public function setAmount(int $amount): TradeLicenseInfo
97
    {
98
        $this->amount = $amount;
99
100
        return $this;
101
    }
102
103 1
    public function getDate(): int
104
    {
105 1
        return $this->date;
106
    }
107
108
    public function setDate(int $date): TradeLicenseInfo
109
    {
110
        $this->date = $date;
111
112
        return $this;
113
    }
114
115 6
    public function getDays(): int
116
    {
117 6
        return $this->days;
118
    }
119
120
    public function setDays(int $days): TradeLicenseInfo
121
    {
122
        $this->days = $days;
123
124
        return $this;
125
    }
126
}
127