public function sum($colName)
    {
        $sum = 0;
        foreach ($this->rows as $row) {
            $sum+=$row[$colName];
        }
        return $sum;
    }
public function sum($colName)
    {
        $sum = 0;
        foreach ($this->rows as $row) {
            $sum+=$row[$colName];
        }
        return $sum;
    }
public function sum ( $ colName ) { $ sum = 0 ; foreach ( $ this -> rows as $ row ) { $ sum += $ row [ $ colName ] ; } return $ sum ; }
Return the sum of a field

Examples: $totalSales = $dataStore->sum("saleAmount");

@param string $colName Name of column you want to sum

@return float Sum of column
Return the sum of a field