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

WormholeRestriction   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 25
dl 0
loc 56
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getUser() 0 3 1
A getMode() 0 3 1
A getId() 0 3 1
A setWormholeEntry() 0 4 1
A setMode() 0 4 1
A setUser() 0 4 1
A getWormholeEntry() 0 3 1
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