Test Setup Failed
Push — main ( 7bb2c5...c5b0e8 )
by Daniel
03:55
created

AccessKey::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\AccessKeyRepository;
10
11
#[ORM\Entity(repositoryClass: AccessKeyRepository::class)]
12
#[ORM\Table(name: 'access_key')]
13
class AccessKey implements AccessKeyInterface
14
{
15
    #[ORM\Column(type: Types::INTEGER)]
16
    #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO')]
17
    private int $id;
18
19
    #[ORM\Column(type: Types::INTEGER)]
20
    private int $type_id = 0;
21
22
    /**
23
     * @var array{
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{ at position 2 could not be parsed: the token is null at position 2.
Loading history...
24
     *  accessKey?: string
25
     * } $config
26
     */
27
    #[ORM\Column(type: Types::JSON)]
28
    private array $config = [];
29
30
    #[ORM\Column(type: Types::BOOLEAN)]
31
    private bool $active = false;
32
33
    #[ORM\Column(type: Types::INTEGER)]
34
    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...
35
36
    #[ORM\ManyToOne(targetEntity: User::class)]
37
    #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
38
    private UserInterface $user;
39
40
    public function getId(): int
41
    {
42
        return $this->id;
43
    }
44
45
    public function getTypeId(): int
46
    {
47
        return $this->type_id;
48
    }
49
50
    public function setTypeId(int $typeId): AccessKeyInterface
51
    {
52
        $this->type_id = $typeId;
53
        return $this;
54
    }
55
56
    public function getActive(): bool
57
    {
58
        return $this->active;
59
    }
60
61
    public function setActive(bool $active): AccessKeyInterface
62
    {
63
        $this->active = $active;
64
        return $this;
65
    }
66
67
    public function getUser(): UserInterface
68
    {
69
        return $this->user;
70
    }
71
72
    public function setUser(UserInterface $user): AccessKeyInterface
73
    {
74
        $this->user = $user;
75
        return $this;
76
    }
77
78
    /**
79
     * @return array{
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{ at position 2 could not be parsed: the token is null at position 2.
Loading history...
80
     *  accessToken?: string
81
     * }
82
     */
83
    public function getConfig(): array
84
    {
85
        return $this->config;
86
    }
87
88
    public function setConfig(array $config): AccessKeyInterface
89
    {
90
        $this->config = $config;
91
        return $this;
92
    }
93
}
94