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\FunctionExpressionavg( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL AVG function.
$expression $types optional [] Cake\Database\Expression\FunctionExpressioncoalesce( array $args , array $types [] )
Returns a FunctionExpression representing a call to SQL COALESCE function.
$args $types optional [] Cake\Database\Expression\FunctionExpressionconcat( array $args , array $types [] )
Returns a FunctionExpression representing a string concatenation
$args $types optional [] Cake\Database\Expression\FunctionExpressioncount( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL COUNT function.
$expression $types optional [] Cake\Database\Expression\FunctionExpressiondateAdd( string $expression , string $value , string $unit , array $types [] )
Add the time unit to the date expression
$expression $value $unit $types optional [] Cake\Database\Expression\FunctionExpressiondateDiff( array $args , array $types [] )
Returns a FunctionExpression representing the difference in days between two dates.
$args $types optional [] Cake\Database\Expression\FunctionExpressiondatePart( string $part , string $expression , array $types [] )
Returns the specified date part from the SQL expression.
$part $expression $types optional [] Cake\Database\Expression\FunctionExpressiondayOfWeek( 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\FunctionExpressionextract( string $part , string $expression , array $types [] )
Returns the specified date part from the SQL expression.
$part $expression $types optional [] Cake\Database\Expression\FunctionExpressionmax( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL MAX function.
$expression $types optional [] Cake\Database\Expression\FunctionExpressionmin( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL MIN function.
$expression $types optional [] Cake\Database\Expression\FunctionExpressionnow( 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\FunctionExpressionsum( mixed $expression , array $types [] )
Returns a FunctionExpression representing a call to SQL SUM function.
$expression $types optional [] Cake\Database\Expression\FunctionExpressionweekday( 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