1 | <?php |
||
8 | class LazyLoadedIndex extends Index |
||
9 | { |
||
10 | protected $pathMap = null; |
||
11 | |||
12 | /** |
||
13 | * @var callable |
||
14 | */ |
||
15 | protected $indexLoader; |
||
16 | |||
17 | public function __construct(callable $indexLoader) |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function addObject(IndexObject $indexObject): Index |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function getObjectByPath(string $path): ?IndexObject |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function getObjectByBlobId(string $blobId): ?IndexObject |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function count(): int |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function getIterator(): \Traversable |
||
71 | |||
72 | /** |
||
73 | * Lazy-loads the actual index from the injected loader. |
||
74 | */ |
||
75 | protected function loadIndex() |
||
89 | } |
||
90 |