PedigreeRelateRecord   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMapperClass() 0 3 1
A addEntries() 0 8 1
1
<?php
2
3
namespace kalanis\kw_pedigree\Storage\MultiTable;
4
5
6
use kalanis\kw_mapper\Interfaces\IEntryType;
7
use kalanis\kw_mapper\Records\ASimpleRecord;
8
9
10
/**
11
 * Class PedigreeRelateRecord
12
 * @property int $id
13
 * @property int $childId
14
 * @property int $parentId
15
 * @property PedigreeItemRecord[] $parents
16
 * @property PedigreeItemRecord[] $children
17
 */
18
class PedigreeRelateRecord extends ASimpleRecord
19
{
20 4
    protected function addEntries(): void
21
    {
22 4
        $this->addEntry('id', IEntryType::TYPE_INTEGER, 2048);
23 4
        $this->addEntry('childId', IEntryType::TYPE_INTEGER, 2048);
24 4
        $this->addEntry('parentId', IEntryType::TYPE_INTEGER, 2048);
25 4
        $this->addEntry('parents', IEntryType::TYPE_ARRAY); // FK - makes the array of entries every time
26 4
        $this->addEntry('children', IEntryType::TYPE_ARRAY); // FK - makes the array of entries every time
27 4
        $this->setMapper($this->getMapperClass());
28 4
    }
29
30
    /**
31
     * @return string
32
     * @codeCoverageIgnore used another one for testing
33
     */
34
    protected function getMapperClass(): string
35
    {
36
        return PedigreeRelateMapper::class;
37
    }
38
}
39