public function last($cb=null)
    {
        if ($cb==null) {
            return $this->isNotEmpty()?$this->rows[$this->count()-1]:null;
        } else {
            //method returns the last element in the collection that passes a given truth test:
            $count = $this->count();
            for ($i=0;$i<$count;$i++) {
                if ($cb($this->rows[$count-$i], $count-$i)===true) {
                    return $this->rows[$count-$i];
                }
            }
        }
        return null;
    }
public function last($cb=null)
    {
        if ($cb==null) {
            return $this->isNotEmpty()?$this->rows[$this->count()-1]:null;
        } else {
            //method returns the last element in the collection that passes a given truth test:
            $count = $this->count();
            for ($i=0;$i<$count;$i++) {
                if ($cb($this->rows[$count-$i], $count-$i)===true) {
                    return $this->rows[$count-$i];
                }
            }
        }
        return null;
    }
public function last ( $ cb = null ) { if ( $ cb == null ) { return $ this -> isNotEmpty ( ) ? $ this -> rows [ $ this -> count ( ) - 1 ] : null ; } else { //method returns the last element in the collection that passes a given truth test: $ count = $ this -> count ( ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { if ( $ cb ( $ this -> rows [ $ count - $ i ] , $ count - $ i ) === true ) { return $ this -> rows [ $ count - $ i ] ; } } } return null ; }
Return the last row that meets a condition set by callback function

Examples:

$lastRow = $store->last(function($row){
return $row["age"]<65;
});

@param function $cb Callback function

@return array The last row that meet conditon
Return the last row that meets a condition set by callback function