Class UnaryExpression
An expression object that represents an expression with only a single operand.
- Cake\Database\Expression\UnaryExpression implements Cake\Database\ExpressionInterface
Constants summary
-
integer
1
-
integer
0
Properties summary
-
$_mode
protectedWhere to place the operatorinteger
-
$_operator
protectedThe operator this unary expression representsstring
-
$_value
protectedHolds the value which the unary expression operatesmixed
Method Summary
- __clone() publicPerform a deep clone of the inner expression.
- __construct() publicConstructor
- sql() publicConverts the expression to its string representation
- traverse() public
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
Method Detail
__construct()source public
__construct( string $operator , mixed $value , integer $mode self::PREFIX )
Constructor
Parameters
- string
$operator
- The operator to used for the expression
- mixed
$value
- the value to use as the operand for the expression
- integer
$mode
optional self::PREFIX - either UnaryExpression::PREFIX or UnaryExpression::POSTFIX
sql()source public
sql( Cake\Database\ValueBinder $generator )
Converts the expression to its string representation
Parameters
- Cake\Database\ValueBinder
$generator
- Placeholder generator object
Returns
stringImplementation of
Cake\Database\ExpressionInterface::sql()
traverse()source public
traverse( callable $callable )
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $visitor callable passing as first parameter the instance of the expression currently being iterated.
Parameters
- callable
$callable
- $visitor The callable to apply to all nodes.
Implementation of
Cake\Database\ExpressionInterface::traverse()
Properties detail
© 2005–2017 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.
https://api.cakephp.org/3.4/class-Cake.Database.Expression.UnaryExpression.html