Passed
Push — master ( 141183...2b56eb )
by Petr
08:03
created

GroupsRecord::getGroupStatus()   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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace kalanis\kw_auth\Sources\Mapper\Database;
4
5
6
use kalanis\kw_auth\Interfaces\IGroup;
7
use kalanis\kw_mapper\Interfaces\IEntryType;
8
use kalanis\kw_mapper\Records\ASimpleRecord;
9
10
11
/**
12
 * Class GroupsRecord
13
 * @package kalanis\kw_auth\Sources\Mapper\Database
14
 * @property int $id
15
 * @property string $name
16
 * @property string $desc
17
 * @property int $status
18
 * @property int $authorId
19
 * @property UsersRecord[] $authors
20
 * @property UsersRecord[] $members
21
 * @codeCoverageIgnore remote source
22
 */
23
class GroupsRecord extends ASimpleRecord implements IGroup
24
{
25
    public function addEntries(): void
26
    {
27
        $this->addEntry('id', IEntryType::TYPE_INTEGER, 2048);
28
        $this->addEntry('name', IEntryType::TYPE_STRING, 512);
29
        $this->addEntry('desc', IEntryType::TYPE_STRING, 512);
30
        $this->addEntry('authorId', IEntryType::TYPE_INTEGER, 128);
31
        $this->addEntry('status', IEntryType::TYPE_INTEGER, 4);
32
        $this->addEntry('authors', IEntryType::TYPE_ARRAY, []);
33
        $this->addEntry('members', IEntryType::TYPE_ARRAY, []);
34
        $this->setMapper(GroupsMapper::class);
35
    }
36
37
    public function getGroupId(): int
38
    {
39
        return intval($this->id);
40
    }
41
42
    public function getGroupName(): string
43
    {
44
        return strval($this->name);
45
    }
46
47
    public function getGroupDesc(): string
48
    {
49
        return strval($this->desc);
50
    }
51
52
    public function getGroupAuthorId(): int
53
    {
54
        return intval($this->authorId);
55
    }
56
57
    public function getGroupStatus(): int
58
    {
59
        return intval($this->status);
60
    }
61
}
62