| 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 | * Add attribute |
||
| 25 | * |
||
| 26 | * @param Attribute $attribute |
||
| 27 | * @throws \LogicException |
||
| 28 | */ |
||
| 29 | public function addAttribute(Attribute $attribute) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Get attributes |
||
| 42 | * |
||
| 43 | * @return Attribute[] |
||
| 44 | */ |
||
| 45 | 1 | public function getAttributes(): array |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Add relationship |
||
| 52 | * |
||
| 53 | * @param Relationship $relationship |
||
| 54 | * @throws \LogicException |
||
| 55 | */ |
||
| 56 | 4 | public function addRelationship(Relationship $relationship) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Get relationships |
||
| 69 | * |
||
| 70 | * @return Relationship[] |
||
| 71 | */ |
||
| 72 | 4 | public function getRelationships(): array |
|
| 76 | } |