| 1 | <?php |
||
| 13 | class Tree extends NodeCollection |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Flat listing of nodes with primary id as collection key. |
||
| 17 | * |
||
| 18 | * @var NodeCollection |
||
| 19 | */ |
||
| 20 | private $index; |
||
| 21 | |||
| 22 | 18 | public function __construct(NodeCollection $nodeCollection, NodeCollection $index) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Count of all nodes |
||
| 30 | * |
||
| 31 | * @return int |
||
| 32 | */ |
||
| 33 | 3 | public function count() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param $id |
||
| 40 | * @return null|Node |
||
| 41 | */ |
||
| 42 | 3 | public function findByIndex($id) |
|
| 46 | |||
| 47 | 6 | public function findManyByIndex(array $ids): NodeCollection |
|
| 59 | } |
||
| 60 |