| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 35 | public static function getParentForPage(Page $page) |
||
| 36 | { |
||
| 37 | /** @var NodeCollection $tree */ |
||
| 38 | $tree = static::getFor($page->flatreference()->get()); |
||
| 39 | |||
| 40 | $page = $tree->find('reference', $page->flatreference()->get()); |
||
| 41 | |||
| 42 | if(($page) && $parent = $page->parent()) { |
||
| 43 | return $parent->reference; |
||
| 44 | } |
||
| 45 | |||
| 46 | return null; |
||
| 47 | } |
||
| 49 |