| 1 | <?php |
||
| 13 | class LazyLoadedIndex extends Index |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var callable |
||
| 17 | */ |
||
| 18 | protected $indexLoader; |
||
| 19 | |||
| 20 | public function __construct(callable $indexLoader) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function addObject(IndexObject $indexObject): Index |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | public function getObjectByPath(string $path): ?IndexObject |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function getObjectByBlobId(string $blobId): ?IndexObject |
||
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | public function count(): int |
||
| 67 | |||
| 68 | /** |
||
| 69 | * {@inheritdoc} |
||
| 70 | */ |
||
| 71 | public function getIterator(): \Traversable |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Lazy-loads the actual index from the injected loader. |
||
| 80 | */ |
||
| 81 | protected function loadIndex() |
||
| 95 | } |
||
| 96 |