Passed
Push — master ( 56d139...0769f1 )
by Aleksandr
02:20
created

EntityFactoryResult::getSetKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the eav package.
4
 * @author    Aleksandr Drobotik <[email protected]>
5
 * @copyright 2023 Aleksandr Drobotik
6
 * @license   https://opensource.org/license/mit  The MIT License
7
 */
8
declare(strict_types=1);
9
10
namespace Drobotik\Eav\Result;
11
12
use Drobotik\Eav\Enum\_ATTR;
13
use Drobotik\Eav\Model\ValueBase;
14
15
class EntityFactoryResult
16
{
17
    private int $entityKey;
18
    private array $pivots = [];
19
    private array $attributes = [];
20
    /** @var ValueBase[] */
21
    private array $values = [];
22
23
    private int $domainKey;
24
    private int $setKey;
25
26
27
    public function setDomainKey(int $key) : void
28
    {
29
        $this->domainKey = $key;
30
    }
31
32
    public function setSetKey(int $key) : void
33
    {
34
        $this->setKey = $key;
35
    }
36
37
    public function getSetKey() : int
38
    {
39
        return $this->setKey;
40
    }
41
42
    public function getDomainKey() : int
43
    {
44
        return $this->domainKey;
45
    }
46
47 1
    public function setEntityKey(int $entityKey): void
48
    {
49 1
        $this->entityKey = $entityKey;
50
    }
51
52 1
    public function getEntityKey(): int
53
    {
54 1
        return $this->entityKey;
55
    }
56
57 1
    public function addAttribute(array $attribute): void
58
    {
59 1
        $this->attributes[$attribute[_ATTR::NAME->column()]] = $attribute;
60
    }
61
62 1
    public function getAttributes(): array
63
    {
64 1
        return $this->attributes;
65
    }
66
67 1
    public function addValue(int $attrKey, int $valueKey): void
68
    {
69 1
        $this->values[$attrKey] = $valueKey;
70
    }
71
72 1
    public function getValues(): array
73
    {
74 1
        return $this->values;
75
    }
76
77 1
    public function addPivot(int $attrKey, int $pivotKey): void
78
    {
79 1
        $this->pivots[$attrKey] = $pivotKey;
80
    }
81
82 1
    public function getPivots() : array
83
    {
84 1
        return $this->pivots;
85
    }
86
}