src/Jsonq.php
public function sum($column = null)
    {
        $this->prepare();

        $sum = 0;
        if (is_null($column)) {
            $sum = array_sum($this->_map);
        } else {
            foreach ($this->_map as $key => $val) {
                $value = $this->getFromNested($val, $column);
                if (is_scalar($value)) {
                    $sum += $value;
                }

            }
        }

        return $sum;
    }
public function sum($column = null)
    {
        $this->prepare();

        $sum = 0;
        if (is_null($column)) {
            $sum = array_sum($this->_map);
        } else {
            foreach ($this->_map as $key => $val) {
                $value = $this->getFromNested($val, $column);
                if (is_scalar($value)) {
                    $sum += $value;
                }

            }
        }

        return $sum;
    }
public function sum ( $ column = null ) { $ this -> prepare ( ) ; $ sum = 0 ; if ( is_null ( $ column ) ) { $ sum = array_sum ( $ this -> _map ) ; } else { foreach ( $ this -> _map as $ key => $ val ) { $ value = $ this -> getFromNested ( $ val , $ column ) ; if ( is_scalar ( $ value ) ) { $ sum += $ value ; } } } return $ sum ; }
sum prepared data
@param int $column
@return int
@throws ConditionNotAllowedException
sum prepared data