Passed
Push — main ( 219221...755753 )
by Daniel
03:54
created

Session::isActive()   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 Uxmp\Core\Orm\Model;
6
7
/**
8
 * @Entity(repositoryClass="\Uxmp\Core\Orm\Repository\SessionRepository")
9
 * @Table(name="session")
10
 */
11
class Session implements SessionInterface
12
{
13
    /**
14
     * @Id
15
     * @Column(type="integer")
16
     * @GeneratedValue
17
     */
18
    private int $id;
19
20
    /**
21
     * @Column(type="string")
22
     */
23
    private string $subject = '';
24
25
    /**
26
     * @Column(type="boolean")
27
     */
28
    private bool $active = false;
29
30
    /**
31
     * @Column(type="integer")
32
     */
33
    private int $user_id = 0;
34
35
    /**
36
     * @ManyToOne(targetEntity="User")
37
     * @JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
38
     */
39
    private UserInterface $user;
40
41
    public function getId(): int
42
    {
43
        return $this->id;
44
    }
45
46 1
    public function getSubject(): string
47
    {
48 1
        return $this->subject;
49
    }
50
51 1
    public function setSubject(string $subject): SessionInterface
52
    {
53 1
        $this->subject = $subject;
54 1
        return $this;
55
    }
56
57 1
    public function getActive(): bool
58
    {
59 1
        return $this->active;
60
    }
61
62 1
    public function setActive(bool $active): SessionInterface
63
    {
64 1
        $this->active = $active;
65 1
        return $this;
66
    }
67
68 1
    public function getUser(): UserInterface
69
    {
70 1
        return $this->user;
71
    }
72
73 1
    public function setUser(UserInterface $user): SessionInterface
74
    {
75 1
        $this->user = $user;
76 1
        return $this;
77
    }
78
}
79