src/ORM/Queries/SQLSelect.php
public function lastRow()
    {
        $query = clone $this;
        $offset = $this->limit ? $this->limit['start'] : 0;

        // Limit index to start in case of empty results
        $index = max($this->count() + $offset - 1, 0);
        $query->setLimit(1, $index);
        return $query;
    }
public function lastRow()
    {
        $query = clone $this;
        $offset = $this->limit ? $this->limit['start'] : 0;

        // Limit index to start in case of empty results
        $index = max($this->count() + $offset - 1, 0);
        $query->setLimit(1, $index);
        return $query;
    }
public function lastRow ( ) { $ query = clone $ this ; $ offset = $ this -> limit ? $ this -> limit [ 'start' ] : 0 ; // Limit index to start in case of empty results $ index = max ( $ this -> count ( ) + $ offset - 1 , 0 ) ; $ query -> setLimit ( 1 , $ index ) ; return $ query ; }
Returns a query that returns only the last row of this query

@return SQLSelect A clone of this object with the last row only
Returns a query that returns only the last row of this query