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

AReadWriteDatabase   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAlias() 0 3 1
A __construct() 0 6 1
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 AReadWriteDatabase
13
 * @package kalanis\kw_mapper\Mappers\Database
14
 * Separated Read and write DB entry without need to reload mapper
15
 * The most parts are similar to usual read/write one, just with separation of read-write operations
16
 */
17
abstract class AReadWriteDatabase extends AMapper
18
{
19
    use TTable;
20
    use TReadDatabase;
21
    use TWriteDatabase;
22
23
    /**
24
     * @throws MapperException
25
     */
26 4
    public function __construct()
27
    {
28 4
        parent::__construct();
29
30 4
        $this->initTReadDatabase();
31 4
        $this->initTWriteDatabase();
32 4
    }
33
34 14
    public function getAlias(): string
35
    {
36 14
        return $this->getTable();
37
    }
38
}
39