Test Failed
Pull Request — dev (#1952)
by Janko
02:59
created

WormholeRestriction::getMode()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
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\JoinColumn;
12
use Doctrine\ORM\Mapping\ManyToOne;
13
use Doctrine\ORM\Mapping\Table;
14
use Stu\Orm\Repository\WormholeRestrictionRepository;
15
16
#[Table(name: 'stu_wormhole_restrictions')]
17
#[Entity(repositoryClass: WormholeRestrictionRepository::class)]
18
class WormholeRestriction
19
{
20
    #[Id]
21
    #[Column(type: 'integer')]
22
    #[GeneratedValue(strategy: 'IDENTITY')]
23
    private int $id;
24
25
    #[ManyToOne(targetEntity: WormholeEntry::class)]
26
    #[JoinColumn(name: 'wormhole_entry_id', nullable: false, referencedColumnName: 'id')]
27
    private WormholeEntry $wormholeEntry;
28
29
    #[ManyToOne(targetEntity: User::class)]
30
    #[JoinColumn(name: 'user_id', nullable: false, referencedColumnName: 'id', onDelete: 'CASCADE')]
31
    private User $user;
32
33
    #[Column(type: 'integer', nullable: true)]
34
    private ?int $mode = null;
35
36
    public function getId(): int
37
    {
38
        return $this->id;
39
    }
40
41
    public function getWormholeEntry(): WormholeEntry
42
    {
43
        return $this->wormholeEntry;
44
    }
45
46
    public function setWormholeEntry(WormholeEntry $wormholeEntry): WormholeRestriction
47
    {
48
        $this->wormholeEntry = $wormholeEntry;
49
        return $this;
50
    }
51
52
    public function getUser(): User
53
    {
54
        return $this->user;
55
    }
56
57
    public function setUser(User $user): WormholeRestriction
58
    {
59
        $this->user = $user;
60
        return $this;
61
    }
62
63
    public function getMode(): ?int
64
    {
65
        return $this->mode;
66
    }
67
68
    public function setMode(?int $mode): WormholeRestriction
69
    {
70
        $this->mode = $mode;
71
        return $this;
72
    }
73
}
74