FileTable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInitialRecords() 0 3 1
A child() 0 8 1
A childNotExist() 0 3 1
1
<?php
2
3
namespace kalanis\kw_mapper\Search\Connector;
4
5
6
use kalanis\kw_mapper\Interfaces\IQueryBuilder;
7
use kalanis\kw_mapper\MapperException;
8
use kalanis\kw_mapper\Records\ARecord;
9
use kalanis\kw_mapper\Storage;
10
11
12
/**
13
 * Class FileTable
14
 * @package kalanis\kw_mapper\Search
15
 * Connect file containing table as datasource
16
 */
17
class FileTable extends Records
18
{
19 1
    public function child(string $childAlias, string $joinType = IQueryBuilder::JOIN_LEFT, string $parentAlias = '', string $customAlias = ''): AConnector
20
    {
21
        // @todo idea: how it will work
22
        //      - from the most far ones load records and filter them by other params
23
        //      - them continue back and compare already available join params defined for each pair
24
        //      - the foremost records will be only that which has been available by previously selected ones
25
        //    De facto do the full table engine inside the php
26 1
        throw new MapperException('Cannot make relations over files!');
27
    }
28
29 1
    public function childNotExist(string $childAlias, string $table, string $column, string $parentAlias = ''): AConnector
30
    {
31 1
        throw new MapperException('Cannot make relations over files!');
32
    }
33
34
    /**
35
     * @throws MapperException
36
     * @return ARecord[]
37
     */
38 17
    protected function getInitialRecords(): array
39
    {
40 17
        return $this->basicRecord->loadMultiple();
41
    }
42
}
43