Passed
Push — master ( 02118d...11fb63 )
by Petr
03:00
created

ADatabase::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace kalanis\kw_mapper\Mappers\Database;
4
5
6
use kalanis\kw_mapper\MapperException;
7
use kalanis\kw_mapper\Mappers\AMapper;
8
use kalanis\kw_mapper\Storage;
9
10
11
/**
12
 * Class ADatabase
13
 * @package kalanis\kw_mapper\Mappers\Database
14
 */
15
abstract class ADatabase extends AMapper
16
{
17
    use TTable;
18
    use TReadDatabase;
19
    use TWriteDatabase;
20
21
    /**
22
     * @throws MapperException
23
     */
24 12
    public function __construct()
25
    {
26 12
        parent::__construct();
27
28 12
        $this->initTReadDatabase();
29 12
        $this->initTWriteDatabase();
30 12
    }
31
32 36
    public function getAlias(): string
33
    {
34 36
        return $this->getTable();
35
    }
36
37 12
    protected function getReadSource(): string
38
    {
39 12
        return $this->getSource();
40
    }
41
42 12
    protected function getWriteSource(): string
43
    {
44 12
        return $this->getSource();
45
    }
46
}
47