method

first_or_last

first_or_last(type, *args)
private

Fetches the first/last using SQL if possible, otherwise from the target array.