Session::getActive()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Model;
6
7
use Doctrine\DBAL\Types\Types;
8
use Doctrine\ORM\Mapping as ORM;
9
use Uxmp\Core\Orm\Repository\SessionRepository;
10
11
#[ORM\Entity(repositoryClass: SessionRepository::class)]
12
#[ORM\Table(name: 'session')]
13
class Session implements SessionInterface
14
{
15
    #[ORM\Column(type: Types::INTEGER)]
16
    #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO')]
17
    private int $id;
18
19
    #[ORM\Column(type: Types::STRING)]
20
    private string $subject = '';
21
22
    #[ORM\Column(type: Types::BOOLEAN)]
23
    private bool $active = false;
24
25
    #[ORM\Column(type: Types::INTEGER)]
26
    private int $user_id = 0;
0 ignored issues
show
introduced by
The private property $user_id is not used, and could be removed.
Loading history...
27
28
    #[ORM\ManyToOne(targetEntity: UserInterface::class)]
29
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
30
    private UserInterface $user;
31
32
    public function getId(): int
33
    {
34
        return $this->id;
35
    }
36
37 1
    public function getSubject(): string
38
    {
39 1
        return $this->subject;
40
    }
41
42 1
    public function setSubject(string $subject): SessionInterface
43
    {
44 1
        $this->subject = $subject;
45 1
        return $this;
46
    }
47
48 1
    public function getActive(): bool
49
    {
50 1
        return $this->active;
51
    }
52
53 1
    public function setActive(bool $active): SessionInterface
54
    {
55 1
        $this->active = $active;
56 1
        return $this;
57
    }
58
59 1
    public function getUser(): UserInterface
60
    {
61 1
        return $this->user;
62
    }
63
64 1
    public function setUser(UserInterface $user): SessionInterface
65
    {
66 1
        $this->user = $user;
67 1
        return $this;
68
    }
69
}
70