Returns an SQL calculation, i.e. COUNT() or MAX()
public calculate ( Model $Model, string $func, array $params = [] ) : string | ||
$Model | Model | The model to get a calculated field for. |
$func | string | Lowercase name of SQL function, i.e. 'count' or 'max' |
$params | array | Function parameters (any values must be quoted manually) |
return | string | An SQL calculation function |