mini\Table\Index\BTreeIndex::findPath()
Method
private
Signature
private function findPath(string $key): array
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$key |
string |
required | Documentation missing |
Returns
array
Documentation
Find path from root to leaf for given key.
Returns flat array: [pageNum, childIdx, pageNum, childIdx, ...]
- pageNum: null for root, otherwise actual page number
- childIdx: -1 for leaf, otherwise which child was followed (0-based)
Example paths:
- [null, -1] - root is a leaf
- [null, 1, 5, -1] - root is internal, followed child[1], leaf is page 5
- [null, 0, 3, 0, 7, -1] - two internal levels before leaf