Bolt\Legacy\Content::next PHP Method

next() public method

Get the next record. In this case 'next' is defined as 'first one published after this one' by default. You can pass a parameter like 'id' or '-title' to use that as the column to sort on.
public next ( string $field = 'datepublish', array $where = [] ) : Content
$field string
$where array
return Content
    public function next($field = 'datepublish', $where = [])
    {
        list($field, $asc) = $this->app['storage']->getSortOrder($field);
        $operator = $asc ? '>' : '<';
        $order = $asc ? ' ASC' : ' DESC';
        $params = [$field => $operator . $this->values[$field], 'limit' => 1, 'order' => $field . $order, 'returnsingle' => true, 'hydrate' => true];
        $pager = [];
        $next = $this->app['storage']->getContent($this->contenttype['singular_slug'], $params, $pager, $where);
        return $next;
    }