Contains methods related to generating FunctionExpression objects with most commonly used SQL functions. This acts as a factory for FunctionExpression objects.
__call( string $name , array $args )
Magic method dispatcher to create custom SQL function calls
$name
$args
Cake\Database\Expression\FunctionExpression
_build( string $name , array $params [] , array $types [] )
Returns a new instance of a FunctionExpression. This is used for generating arbitrary function calls in the final SQL string.
$name
$params
optional [] $types
optional [] Cake\Database\Expression\FunctionExpression
_literalArgumentFunction( string $name , mixed $expression , array $types [] )
Helper function to build a function expression that only takes one literal argument.
$name
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
avg( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL AVG function.
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
coalesce( array $args , array $types [] )
Returns a FunctionExpression representing a call to SQL COALESCE function.
$args
$types
optional [] Cake\Database\Expression\FunctionExpression
concat( array $args , array $types [] )
Returns a FunctionExpression representing a string concatenation
$args
$types
optional [] Cake\Database\Expression\FunctionExpression
count( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL COUNT function.
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
dateAdd( string $expression , string $value , string $unit , array $types [] )
Add the time unit to the date expression
$expression
$value
$unit
$types
optional [] Cake\Database\Expression\FunctionExpression
dateDiff( array $args , array $types [] )
Returns a FunctionExpression representing the difference in days between two dates.
$args
$types
optional [] Cake\Database\Expression\FunctionExpression
datePart( string $part , string $expression , array $types [] )
Returns the specified date part from the SQL expression.
$part
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
dayOfWeek( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL WEEKDAY function. 1 - Sunday, 2 - Monday, 3 - Tuesday...
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
extract( string $part , string $expression , array $types [] )
Returns the specified date part from the SQL expression.
$part
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
max( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL MAX function.
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
min( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL MIN function.
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
now( string $type 'datetime' )
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.
$type
optional 'datetime' Cake\Database\Expression\FunctionExpression
sum( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL SUM function.
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
weekday( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL WEEKDAY function. 1 - Sunday, 2 - Monday, 3 - Tuesday...
$expression
$types
optional [] Cake\Database\Expression\FunctionExpression
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Database.FunctionsBuilder.html