1 | <?php |
||
11 | class Definition |
||
12 | { |
||
13 | /** |
||
14 | * @var Attribute[] |
||
15 | */ |
||
16 | protected $attributes = []; |
||
17 | |||
18 | /** |
||
19 | * @var Relationship[] |
||
20 | */ |
||
21 | protected $relationships = []; |
||
22 | |||
23 | /** |
||
24 | * @var Link[] |
||
25 | */ |
||
26 | protected $links = []; |
||
27 | |||
28 | /** |
||
29 | * Add attribute |
||
30 | * |
||
31 | * @param Attribute $attribute |
||
32 | * @throws \LogicException |
||
33 | */ |
||
34 | public function addAttribute(Attribute $attribute) |
||
44 | |||
45 | /** |
||
46 | * Get attributes |
||
47 | * |
||
48 | * @return Attribute[] |
||
49 | */ |
||
50 | 1 | public function getAttributes(): array |
|
54 | |||
55 | /** |
||
56 | * Add relationship |
||
57 | * |
||
58 | * @param Relationship $relationship |
||
59 | * @throws \LogicException |
||
60 | */ |
||
61 | 4 | public function addRelationship(Relationship $relationship) |
|
71 | |||
72 | /** |
||
73 | * Get relationships |
||
74 | * |
||
75 | * @return Relationship[] |
||
76 | */ |
||
77 | 4 | public function getRelationships(): array |
|
81 | |||
82 | /** |
||
83 | * Add link |
||
84 | * |
||
85 | * @param Link $link |
||
86 | */ |
||
87 | 2 | public function addLink(Link $link) |
|
97 | |||
98 | /** |
||
99 | * Get links |
||
100 | * |
||
101 | * @return Link[] |
||
102 | */ |
||
103 | 1 | public function getLinks(): array |
|
107 | } |