| 1 | <?php |
||
| 9 | class AncestorQueryBuilder implements AncestorQueryBuilderInterface |
||
| 10 | { |
||
| 11 | private $adapter; |
||
| 12 | |||
| 13 | private $excludeFirstNLevel = 0; |
||
| 14 | private $excludeLastNLevel = 0; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param AdapterInterface $adapter |
||
| 18 | */ |
||
| 19 | 4 | public function __construct(AdapterInterface $adapter) |
|
| 23 | |||
| 24 | 4 | public function get($nodeId): array |
|
| 29 | |||
| 30 | 1 | public function excludeFirstNLevel(int $count): AncestorQueryBuilderInterface |
|
| 31 | { |
||
| 32 | 1 | $this->excludeFirstNLevel = $count; |
|
| 33 | |||
| 34 | 1 | return $this; |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | public function excludeLastNLevel(int $count): AncestorQueryBuilderInterface |
|
| 38 | { |
||
| 39 | 2 | $this->excludeLastNLevel = $count; |
|
| 40 | |||
| 41 | 2 | return $this; |
|
| 42 | } |
||
| 43 | |||
| 44 | 4 | private function getAdapter(): AdapterInterface |
|
| 48 | } |
||
| 49 |