IFunctionBuilder¶
-
interface
OCP\DB\QueryBuilder\
IFunctionBuilder
¶ - This class provides a builder for sql some functions
Implemented by: OC\DB\QueryBuilder\FunctionBuilder\FunctionBuilder
Source: lib/public/DB/QueryBuilder/IFunctionBuilder.php#33
Methods¶
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
md5
($input)¶ - Calculates the MD5 hash of a given input
Source: Parameters: - $input (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The input to be hashed
Returns: Since: 12.0.0
- $input (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
concat
($x, $y)¶ - Combines two input strings
Source: Parameters: - $x (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The first input string - $y (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The seccond input string
Returns: Since: 12.0.0
- $x (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
substring
($input, $start, $length=null)¶ - Takes a substring from the input string
Source: Parameters: - $input (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The input string - $start (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The start of the substring, note that counting starts at 1 - $length (null |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The length of the substring
Returns: Since: 12.0.0
- $input (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
sum
($field)¶ - Takes the sum of all rows in a column
Source: Parameters: - $field (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) the column to sum
Returns: Since: 12.0.0
- $field (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
lower
($field)¶ - Transforms a string field or value to lower case
Source: Parameters: - $field (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
)
Returns: Since: 14.0.0
- $field (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
add
($x, $y)¶ Source: Parameters: - $x (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The first input field or number - $y (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The second input field or number
Returns: Since: 14.0.0
- $x (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
subtract
($x, $y)¶ Source: Parameters: - $x (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The first input field or number - $y (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The second input field or number
Returns: Since: 14.0.0
- $x (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
count
($count="", $alias="")¶ Source: Parameters: - $count (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) The input to be counted - $alias (string) Alias for the counter
Returns: Since: 14.0.0
- $count (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
max
($field)¶ - Takes the maximum of all rows in a columnIf you want to get the maximum value of multiple columns in the same row, use `greatest` instead
Source: Parameters: - $field (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) the column to maximum
Returns: Since: 18.0.0
- $field (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
min
($field)¶ - Takes the minimum of all rows in a columnIf you want to get the minimum value of multiple columns in the same row, use `least` instead
Source: Parameters: - $field (string |
\OCP\DB\QueryBuilder\ILiteral
|\OCP\DB\QueryBuilder\IParameter
|\OCP\DB\QueryBuilder\IQueryFunction
) the column to minimum
Returns: Since: 18.0.0
- $field (string |
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
greatest
($x, $y)¶ - Takes the maximum of multiple valuesIf you want to get the maximum value of all rows in a column, use `max` instead
Source: Parameters: Returns: Since: 18.0.0
-
public
OCP\DB\QueryBuilder\IFunctionBuilder::
least
($x, $y)¶ - Takes the minimum of multiple valuesIf you want to get the minimum value of all rows in a column, use `min` instead
Source: Parameters: Returns: Since: 18.0.0