\Cake\Database\ExpressionUnaryExpression

An expression object that represents an expression with only a single operand.

Summary

Methods
Properties
Constants
__construct()
sql()
traverse()
__clone()
No public properties found
PREFIX
POSTFIX
No protected methods found
$_operator
$_value
$_mode
N/A
No private methods found
No private properties found
N/A

Constants

PREFIX

PREFIX = 0

Indicates that the operation is in pre-order

POSTFIX

POSTFIX = 1

Indicates that the operation is in post-order

Properties

$_operator

$_operator : string

The operator this unary expression represents

Type

string

$_value

$_value : mixed

Holds the value which the unary expression operates

Type

mixed

$_mode

$_mode : integer

Where to place the operator

Type

integer

Methods

__construct()

__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

either UnaryExpression::PREFIX or UnaryExpression::POSTFIX

sql()

sql(\Cake\Database\ValueBinder  $generator) : string

Converts the expression to its string representation

Parameters

\Cake\Database\ValueBinder $generator

Placeholder generator object

Returns

string

traverse()

traverse(callable  $callable) : void

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

__clone()

__clone() : void

Perform a deep clone of the inner expression.