lithium\util\Collection::prev()
Moves backward to the previous item. If already at the first item, moves to the last one.
Returns
mixedThe current item after moving or the last item on failure.
Source
public function prev() {
if (!prev($this->_data)) {
end($this->_data);
}
return current($this->_data);
}