/** * @param Page $page * * @return string */ public function getPrefix(Page $page) { $parent = $page->getParent(); if ($parent === null) { return ''; } return $parent->getChildPageUrlPrefix() ?: $page->getParent()->url()->getLocation(); }
public function build(Builder $query) { list($column, $direction) = $this->currentPage->getParent()->getChildOrderingPolicy(); if ($this->direction === 'before' && $direction === 'asc' || $this->direction === 'after' && $direction === 'desc') { $operator = '<'; $direction = 'desc'; } else { $operator = '>'; $direction = 'asc'; } return $query->where($column, $operator . '=', $this->getValue($column))->where('pages.id', $operator, $this->currentPage->getId())->limit(1)->orderBy($column, $direction); }
public function getPrefix(Page $page) { return $page->getParent()->getChildPageUrlPrefix() ?: $page->getParent()->url()->getLocation(); }