1 | <?php |
||
11 | final class InMemory implements Repository |
||
12 | { |
||
13 | /** |
||
14 | * @var array|Definition[] |
||
15 | */ |
||
16 | private $entityDefinitions; |
||
17 | |||
18 | /** |
||
19 | * @param array $entityDefinitions |
||
20 | * @throws InvalidArgumentException |
||
21 | */ |
||
22 | public function __construct($entityDefinitions = []) |
||
40 | |||
41 | /** |
||
42 | * @param Definition $entityDefinition |
||
43 | */ |
||
44 | public function addDefinition(Definition $entityDefinition) |
||
48 | |||
49 | /** |
||
50 | * @param $entity |
||
51 | * @return bool |
||
52 | * @throws InvalidArgumentException |
||
53 | */ |
||
54 | public function hasDefinition($entity) |
||
62 | |||
63 | /** |
||
64 | * @param $entity |
||
65 | * @return Definition |
||
66 | * @throws RuntimeException |
||
67 | */ |
||
68 | public function getDefinition($entity) |
||
76 | |||
77 | /** |
||
78 | * @throws InvalidArgumentException |
||
79 | */ |
||
80 | private function validateAssociations() |
||
88 | |||
89 | /** |
||
90 | * @param Definition $definition |
||
91 | * @param Property $property |
||
92 | * @throws InvalidArgumentException |
||
93 | */ |
||
94 | private function validateAssociation(Definition $definition, Property $property) |
||
109 | } |
||
110 |