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

UsersMapper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setMap() 0 13 1
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