public higherItems ( integer $limit = NULL ) : mixed | ||
$limit | integer | The number of items to return |
return | mixed | Returned items will be of the same type as the current class instance |
public function higherItems($limit = NULL)
{
if ($limit === NULL) {
$limit = $this->listifyList()->count();
}
$position_value = $this->getListifyPosition();
return $this->listifyList()->where($this->positionColumn(), "<", $position_value)->where($this->positionColumn(), ">=", $position_value - $limit)->take($limit)->orderBy($this->getTable() . "." . $this->positionColumn(), "ASC")->get();
}