1 | <?php |
||
16 | class BatchingEntityFetcher implements BatchingFetcher { |
||
17 | |||
18 | private $entityIdFetcher; |
||
19 | private $entityLookup; |
||
20 | private $onEntitySkipped; |
||
21 | |||
22 | /** |
||
23 | * @param BatchingFetcher $entityIdFetcher |
||
24 | * @param EntityLookup $entityLookup |
||
25 | * @param callable|null $onEntitySkipped with two parameters, EntityId $entityId and string $reasonMessage |
||
26 | */ |
||
27 | public function __construct( BatchingFetcher $entityIdFetcher, EntityLookup $entityLookup, $onEntitySkipped = null ) { |
||
32 | |||
33 | /** |
||
34 | * @see BatchingFetcher::fetchNext |
||
35 | * |
||
36 | * @param int $maxFetchCount |
||
37 | * |
||
38 | * @return Entity[] |
||
39 | */ |
||
40 | public function fetchNext( $maxFetchCount ) { |
||
49 | |||
50 | private function retrieveEntities( array $entityIds ) { |
||
63 | |||
64 | private function retrieveEntity( EntityId $entityId ) { |
||
79 | |||
80 | private function reportSkippedEntity( EntityId $entityId, $reasonMessage ) { |
||
85 | |||
86 | /** |
||
87 | * @see BatchingFetcher::rewind |
||
88 | */ |
||
89 | public function rewind() { |
||
92 | |||
93 | } |
||
94 |