IFunctionBuilder
in
This class provides a builder for sql some functions
Tags
Table of Contents
Methods
- add() : IQueryFunction
- charLength() : IQueryFunction
- concat() : IQueryFunction
- Combines two input strings
- count() : IQueryFunction
- greatest() : IQueryFunction
- Takes the maximum of multiple values
- groupConcat() : IQueryFunction
- Returns a string which is the concatenation of all non-NULL values of X
- least() : IQueryFunction
- Takes the minimum of multiple values
- lower() : IQueryFunction
- Transforms a string field or value to lower case
- max() : IQueryFunction
- Takes the maximum of all rows in a column
- md5() : IQueryFunction
- Calculates the MD5 hash of a given input
- min() : IQueryFunction
- Takes the minimum of all rows in a column
- octetLength() : IQueryFunction
- substring() : IQueryFunction
- Takes a substring from the input string
- subtract() : IQueryFunction
- sum() : IQueryFunction
- Takes the sum of all rows in a column
Methods
add()
public
add(string|ILiteral|IParameter|IQueryFunction $x, string|ILiteral|IParameter|IQueryFunction $y) : IQueryFunction
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The first input field or number
- $y : string|ILiteral|IParameter|IQueryFunction
-
The second input field or number
Tags
Return values
IQueryFunctioncharLength()
public
charLength(string|ILiteral|IParameter|IQueryFunction $field[, string $alias = '' ]) : IQueryFunction
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
-
The input to be measured
- $alias : string = ''
-
Alias for the length
Tags
Return values
IQueryFunctionconcat()
Combines two input strings
public
concat(string|ILiteral|IParameter|IQueryFunction $x, mixed ...$expr, string|ILiteral|IParameter|IQueryFunction ...$exprs) : IQueryFunction
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
Expressions or literal strings
- $expr : mixed
- $exprs : string|ILiteral|IParameter|IQueryFunction
-
Expressions or literal strings
Tags
Return values
IQueryFunctioncount()
public
count([string|ILiteral|IParameter|IQueryFunction $count = '' ][, string $alias = '' ]) : IQueryFunction
Parameters
- $count : string|ILiteral|IParameter|IQueryFunction = ''
-
The input to be counted
- $alias : string = ''
-
Alias for the counter
Tags
Return values
IQueryFunctiongreatest()
Takes the maximum of multiple values
public
greatest(string|ILiteral|IParameter|IQueryFunction $x, string|ILiteral|IParameter|IQueryFunction $y) : IQueryFunction
If you want to get the maximum value of all rows in a column, use max
instead
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
- $y : string|ILiteral|IParameter|IQueryFunction
Tags
Return values
IQueryFunctiongroupConcat()
Returns a string which is the concatenation of all non-NULL values of X
public
groupConcat(string|IQueryFunction $expr[, string|null $separator = ',' ]) : IQueryFunction
Usage examples:
groupConcat('column') -- with comma as separator (default separator)
groupConcat('column', ';') -- with different separator
Parameters
- $expr : string|IQueryFunction
-
The expression to group
- $separator : string|null = ','
-
The separator
Tags
Return values
IQueryFunctionleast()
Takes the minimum of multiple values
public
least(string|ILiteral|IParameter|IQueryFunction $x, string|ILiteral|IParameter|IQueryFunction $y) : IQueryFunction
If you want to get the minimum value of all rows in a column, use min
instead
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
- $y : string|ILiteral|IParameter|IQueryFunction
Tags
Return values
IQueryFunctionlower()
Transforms a string field or value to lower case
public
lower(string|ILiteral|IParameter|IQueryFunction $field) : IQueryFunction
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
Tags
Return values
IQueryFunctionmax()
Takes the maximum of all rows in a column
public
max(string|ILiteral|IParameter|IQueryFunction $field) : IQueryFunction
If you want to get the maximum value of multiple columns in the same row, use greatest
instead
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
-
the column to maximum
Tags
Return values
IQueryFunctionmd5()
Calculates the MD5 hash of a given input
public
md5(string|ILiteral|IParameter|IQueryFunction $input) : IQueryFunction
Parameters
- $input : string|ILiteral|IParameter|IQueryFunction
-
The input to be hashed
Tags
Return values
IQueryFunctionmin()
Takes the minimum of all rows in a column
public
min(string|ILiteral|IParameter|IQueryFunction $field) : IQueryFunction
If you want to get the minimum value of multiple columns in the same row, use least
instead
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
-
the column to minimum
Tags
Return values
IQueryFunctionoctetLength()
public
octetLength(string|ILiteral|IParameter|IQueryFunction $field[, string $alias = '' ]) : IQueryFunction
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
-
The input to be measured
- $alias : string = ''
-
Alias for the length
Tags
Return values
IQueryFunctionsubstring()
Takes a substring from the input string
public
substring(string|ILiteral|IParameter|IQueryFunction $input, string|ILiteral|IParameter|IQueryFunction $start[, null|ILiteral|IParameter|IQueryFunction $length = null ]) : IQueryFunction
Parameters
- $input : string|ILiteral|IParameter|IQueryFunction
-
The input string
- $start : string|ILiteral|IParameter|IQueryFunction
-
The start of the substring, note that counting starts at 1
- $length : null|ILiteral|IParameter|IQueryFunction = null
-
The length of the substring
Tags
Return values
IQueryFunctionsubtract()
public
subtract(string|ILiteral|IParameter|IQueryFunction $x, string|ILiteral|IParameter|IQueryFunction $y) : IQueryFunction
Parameters
- $x : string|ILiteral|IParameter|IQueryFunction
-
The first input field or number
- $y : string|ILiteral|IParameter|IQueryFunction
-
The second input field or number
Tags
Return values
IQueryFunctionsum()
Takes the sum of all rows in a column
public
sum(string|ILiteral|IParameter|IQueryFunction $field) : IQueryFunction
Parameters
- $field : string|ILiteral|IParameter|IQueryFunction
-
the column to sum