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

Session   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Test Coverage

Coverage 88.24%

Importance

Changes 0
Metric Value
wmc 7
eloc 16
dl 0
loc 66
ccs 15
cts 17
cp 0.8824
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getActive() 0 3 1
A getSubject() 0 3 1
A setSubject() 0 4 1
A getUser() 0 3 1
A setActive() 0 4 1
A setUser() 0 4 1
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