Passed
Push — master ( d309df...7ec489 )
by Petr
02:37
created

UsersMapper::setMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 11
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 13
rs 9.9
1
<?php
2
3
namespace kalanis\kw_auth\Sources\Mapper\Database;
4
5
6
use kalanis\kw_mapper\Mappers\Database\ADatabase;
7
8
9
/**
10
 * Class UsersMapper
11
 * @package kalanis\kw_auth\Data\Mapper\Database
12
 * @codeCoverageIgnore remote source
13
 */
14
class UsersMapper extends ADatabase
15
{
16
    protected function setMap(): void
17
    {
18
        $this->setSource('default_database');
19
        $this->setTable('users');
20
        $this->setRelation('id', 'u_id');
21
        $this->setRelation('login', 'u_login');
22
        $this->setRelation('pass', 'u_pass');
23
        $this->setRelation('groupId', 'gr_id');
24
        $this->setRelation('display', 'u_display');
25
        $this->setRelation('cert', 'u_cert');
26
        $this->setRelation('salt', 'u_salt');
27
        $this->addPrimaryKey('id');
28
        $this->addForeignKey('groups', '\kalanis\kw_auth\Sources\Mapper\Database\GroupsRecord', 'groupId', 'id');
29
    }
30
}
31