1 | <?php |
||
15 | class InMemoryEntityLookup implements EntityDocumentLookup { |
||
16 | |||
17 | /** |
||
18 | * @var EntityDocument[] |
||
19 | */ |
||
20 | private $entities = []; |
||
21 | |||
22 | /** |
||
23 | * @param EntityDocument[] $entities |
||
24 | */ |
||
25 | 3 | public function __construct( array $entities ) { |
|
28 | |||
29 | 3 | private function buildEntitiesArray( array $entities ) { |
|
30 | /** @var EntityDocument $entity */ |
||
31 | 3 | foreach( $entities as $entity ) { |
|
32 | 2 | $this->entities[$entity->getId()->getSerialization()] = $entity; |
|
33 | 3 | } |
|
34 | 3 | } |
|
35 | |||
36 | /** |
||
37 | * @see EntityDocumentLookup::getEntityDocumentForId |
||
38 | */ |
||
39 | 3 | public function getEntityDocumentForId( EntityId $entityId ) { |
|
43 | |||
44 | /** |
||
45 | * @see EntityDocumentLookup::getEntityDocumentsForIds |
||
46 | */ |
||
47 | 1 | public function getEntityDocumentsForIds( array $entityIds ) { |
|
59 | } |
||
60 |