rand()
rand() : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL RAND function.
Contains methods related to generating FunctionExpression objects with most commonly used SQL functions.
This acts as a factory for FunctionExpression objects.
rand() : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL RAND function.
sum(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL SUM function.
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
avg(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL AVG function.
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
max(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL MAX function.
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
min(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL MIN function.
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
count(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL COUNT function.
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
concat(array $args, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a string concatenation
array | $args | List of strings or expressions to concatenate |
array | $types | list of types to bind to the arguments |
coalesce(array $args, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL COALESCE function.
array | $args | List of expressions to evaluate as function parameters |
array | $types | list of types to bind to the arguments |
dateDiff(array $args, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing the difference in days between two dates.
array | $args | List of expressions to obtain the difference in days. |
array | $types | list of types to bind to the arguments |
datePart(string $part, string $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns the specified date part from the SQL expression.
string | $part | Part of the date to return. |
string | $expression | Expression to obtain the date part from. |
array | $types | list of types to bind to the arguments |
extract(string $part, string $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns the specified date part from the SQL expression.
string | $part | Part of the date to return. |
string | $expression | Expression to obtain the date part from. |
array | $types | list of types to bind to the arguments |
dateAdd(string $expression, string $value, string $unit, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Add the time unit to the date expression
string | $expression | Expression to obtain the date part from. |
string | $value | Value to be added. Use negative to subtract. |
string | $unit | Unit of the value e.g. hour or day. |
array | $types | list of types to bind to the arguments |
dayOfWeek(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL WEEKDAY function.
1 - Sunday, 2 - Monday, 3 - Tuesday...
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
weekday(mixed $expression, array $types = array()) : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call to SQL WEEKDAY function.
1 - Sunday, 2 - Monday, 3 - Tuesday...
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
now(string $type = 'datetime') : \Cake\Database\Expression\FunctionExpression
Returns a FunctionExpression representing a call that will return the current date and time. By default it returns both date and time, but you can also make it generate only the date or only the time.
string | $type | (datetime|date|time) |
__call(string $name, array $args) : \Cake\Database\Expression\FunctionExpression
Magic method dispatcher to create custom SQL function calls
string | $name | the SQL function name to construct |
array | $args | list with up to 3 arguments, first one being an array with parameters for the SQL function, the second one a list of types to bind to those params, and the third one the return type of the function |
_build(string $name, array $params = array(), array $types = array(), string $return = 'string') : \Cake\Database\Expression\FunctionExpression
Returns a new instance of a FunctionExpression. This is used for generating arbitrary function calls in the final SQL string.
string | $name | the name of the SQL function to constructed |
array | $params | list of params to be passed to the function |
array | $types | list of types for each function param |
string | $return | The return type of the function expression |
_literalArgumentFunction(string $name, mixed $expression, array $types = array(), string $return = 'string') : \Cake\Database\Expression\FunctionExpression
Helper function to build a function expression that only takes one literal argument.
string | $name | name of the function to build |
mixed | $expression | the function argument |
array | $types | list of types to bind to the arguments |
string | $return | The return type for the function |