Passed
Push — dev ( 91d807...b97e85 )
by Janko
28:41
created

PirateWrath::getProtectionTimeout()   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 0
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\Id;
10
use Doctrine\ORM\Mapping\JoinColumn;
11
use Doctrine\ORM\Mapping\OneToOne;
12
use Doctrine\ORM\Mapping\Table;
13
14
#[Table(name: 'stu_pirate_wrath')]
15
#[Entity(repositoryClass: 'Stu\Orm\Repository\PirateWrathRepository')]
16
class PirateWrath implements PirateWrathInterface
17
{
18
    #[Id]
19
    #[Column(type: 'integer')]
20
    private int $user_id;
0 ignored issues
show
introduced by
The private property $user_id is not used, and could be removed.
Loading history...
21
22
    #[Column(type: 'integer')]
23
    private int $wrath = 100;
24
25
    #[Column(type: 'integer', nullable: true)]
26
    private ?int $protection_timeout = null;
27
28
    #[OneToOne(targetEntity: 'User', inversedBy: 'pirateWrath')]
29
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
30
    private UserInterface $user;
31
32
    public function getUser(): UserInterface
33
    {
34
        return $this->user;
35
    }
36
37
    public function setUser(UserInterface $user): PirateWrathInterface
38
    {
39
        $this->user = $user;
40
41
        return $this;
42
    }
43
44
    public function getWrath(): int
45
    {
46
        return $this->wrath;
47
    }
48
49
    public function setWrath(int $wrath): PirateWrathInterface
50
    {
51
        $this->wrath = $wrath;
52
53
        return $this;
54
    }
55
56
    public function getProtectionTimeout(): ?int
57
    {
58
        return $this->protection_timeout;
59
    }
60
61
    public function setProtectionTimeout(?int $timestamp): PirateWrathInterface
62
    {
63
        $this->protection_timeout = $timestamp;
64
65
        return $this;
66
    }
67
}
68