|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of the eav package. |
|
4
|
|
|
* @author Alex Kuperwood <[email protected]> |
|
5
|
|
|
* @copyright 2025 Alex Kuperwood |
|
6
|
|
|
* @license https://opensource.org/license/mit The MIT License |
|
7
|
|
|
*/ |
|
8
|
|
|
declare(strict_types=1); |
|
9
|
|
|
|
|
10
|
|
|
namespace Kuperwood\Eav\Result; |
|
11
|
|
|
|
|
12
|
|
|
use Kuperwood\Eav\Enum\_ATTR; |
|
13
|
|
|
use Kuperwood\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
|
1 |
|
public function setDomainKey(int $key) : void |
|
28
|
|
|
{ |
|
29
|
1 |
|
$this->domainKey = $key; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
1 |
|
public function setSetKey(int $key) : void |
|
33
|
|
|
{ |
|
34
|
1 |
|
$this->setKey = $key; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
1 |
|
public function getSetKey() : int |
|
38
|
|
|
{ |
|
39
|
1 |
|
return $this->setKey; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
1 |
|
public function getDomainKey() : int |
|
43
|
|
|
{ |
|
44
|
1 |
|
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]] = $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
|
|
|
} |