1 | <?php |
||
11 | class Index implements \Countable, \IteratorAggregate |
||
12 | { |
||
13 | /** |
||
14 | * @var IndexObject[] |
||
15 | */ |
||
16 | protected $pathMap = []; |
||
17 | |||
18 | /** |
||
19 | * Adds the given object to the index. |
||
20 | * |
||
21 | * @param IndexObject $indexObject |
||
22 | * @return Index |
||
23 | * @throws Exception |
||
24 | */ |
||
25 | public function addObject(IndexObject $indexObject): Index |
||
46 | |||
47 | /** |
||
48 | * Returns an index object by a given relative path. |
||
49 | * |
||
50 | * @param string $path |
||
51 | * @return IndexObject|null |
||
52 | */ |
||
53 | public function getObjectByPath(string $path): ?IndexObject |
||
57 | |||
58 | /** |
||
59 | * Returns an index object by a given blob id. |
||
60 | * |
||
61 | * @param string $blobId |
||
62 | * @return IndexObject|null |
||
63 | */ |
||
64 | public function getObjectByBlobId(string $blobId): ?IndexObject |
||
76 | |||
77 | /** |
||
78 | * Compares this index to the given index and returns the comparison result as boolean indicator. |
||
79 | * |
||
80 | * @param Index|null $other |
||
81 | * @return bool |
||
82 | */ |
||
83 | public function equals(Index $other = null): bool |
||
92 | |||
93 | /** |
||
94 | * Returns true if this index is a subset of the given index. |
||
95 | * |
||
96 | * @param Index $other |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function isSubsetOf(Index $other): bool |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function count(): int |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function getIterator(): \Traversable |
||
130 | } |
||
131 |