/** * @param $query * @return mixed */ private function addOrdering($query) { if ($this->using_custom_order) { return $query; } $order = 'manual'; if ($this->parent_page_id != 0) { try { $parent = $this->repository->findById($this->parent_page_id); $order = $parent->sub_page_order; } catch (\CoandaCMS\Coanda\Pages\Exceptions\PageNotFound $exception) { // Default to manual above... } } $query = $this->handleOrder($order, $query); return $query; }