RecordsInJoin   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 34
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getKnownAs() 0 3 1
A setData() 0 7 2
A getRecord() 0 3 1
A getStoreKey() 0 3 1
A getParentAlias() 0 3 1
1
<?php
2
3
namespace kalanis\kw_mapper\Search\Connector\Database;
4
5
6
use kalanis\kw_mapper\Records\ARecord;
7
8
9
/**
10
 * Class RecordsInJoin
11
 * @package kalanis\kw_mapper\Search\Connector\Database
12
 * Structure to access records which come in joins
13
 */
14
class RecordsInJoin
15
{
16
    protected ?ARecord $record = null;
17
    protected ?string $parentAlias = null;
18
    protected string $storeKey = '';
19
    protected string $knownAs = '';
20
21 89
    public function setData(ARecord $record, string $storeKey, ?string $parentAlias, string $knownAs = ''): self
22
    {
23 89
        $this->record = $record;
24 89
        $this->parentAlias = $parentAlias;
25 89
        $this->storeKey = $storeKey;
26 89
        $this->knownAs = empty($knownAs) ? $storeKey : $knownAs ;
27 89
        return $this;
28
    }
29
30 22
    public function getRecord(): ?ARecord
31
    {
32 22
        return $this->record;
33
    }
34
35 11
    public function getParentAlias(): ?string
36
    {
37 11
        return $this->parentAlias;
38
    }
39
40 14
    public function getStoreKey(): string
41
    {
42 14
        return $this->storeKey;
43
    }
44
45 4
    public function getKnownAs(): string
46
    {
47 4
        return $this->knownAs;
48
    }
49
}
50