src/mako/database/query/Query.php
protected function aggregate(string $function, $column)
	{
		$this->select([new Raw(sprintf($function, $this->compiler->columns(is_array($column) ? $column : [$column])))]);

		if($this->inSubqueryContext === false)
		{
			$query = $this->compiler->select();

			return $this->connection->column($query['sql'], $query['params']);
		}
	}
protected function aggregate(string $function, $column)
	{
		$this->select([new Raw(sprintf($function, $this->compiler->columns(is_array($column) ? $column : [$column])))]);

		if($this->inSubqueryContext === false)
		{
			$query = $this->compiler->select();

			return $this->connection->column($query['sql'], $query['params']);
		}
	}
protected function aggregate ( string $ function , $ column ) { $ this -> select ( [ new Raw ( sprintf ( $ function , $ this -> compiler -> columns ( is_array ( $ column ) ? $ column : [ $ column ] ) ) ) ] ) ; if ( $ this -> inSubqueryContext === false ) { $ query = $ this -> compiler -> select ( ) ; return $ this -> connection -> column ( $ query [ 'sql' ] , $ query [ 'params' ] ) ; } }
Sets the selected column of the query to the chosen aggreate.
Executes the query and returns the result if not in subquery context.

@param  string       $function Aggregate function
@param  string|array $column   Column name or array of column names
@return mixed
Sets the selected column of the query to the chosen aggreate . Executes the query and returns the result if not in subquery context .