Fr3nch13/CakePHP Utilities

UnaryExpression
in package
implements ExpressionInterface

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

Table of Contents

Interfaces

ExpressionInterface
An interface used by Expression objects.

Constants

POSTFIX  = 1
Indicates that the operation is in post-order
PREFIX  = 0
Indicates that the operation is in pre-order

Properties

$_operator  : string
The operator this unary expression represents
$_value  : mixed
Holds the value which the unary expression operates
$position  : int
Where to place the operator

Methods

__clone()  : void
Perform a deep clone of the inner expression.
__construct()  : mixed
Constructor
sql()  : string
Converts the Node into a SQL string fragment.
traverse()  : $this
Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.

Constants

POSTFIX

Indicates that the operation is in post-order

public int POSTFIX = 1

PREFIX

Indicates that the operation is in pre-order

public int PREFIX = 0

Properties

$_operator

The operator this unary expression represents

protected string $_operator

$_value

Holds the value which the unary expression operates

protected mixed $_value

Methods

__clone()

Perform a deep clone of the inner expression.

public __clone() : void

__construct()

Constructor

public __construct(string $operator, mixed $value[, int $position = self::PREFIX ]) : mixed
Parameters
$operator : string

The operator to used for the expression

$value : mixed

the value to use as the operand for the expression

$position : int = self::PREFIX

either UnaryExpression::PREFIX or UnaryExpression::POSTFIX

sql()

Converts the Node into a SQL string fragment.

public sql(ValueBinder $binder) : string
Parameters
$binder : ValueBinder

Parameter binder

Tags
inheritDoc
Return values
string

traverse()

Iterates over each part of the expression recursively for every level of the expressions tree and executes the $callback callable passing as first parameter the instance of the expression currently being iterated.

public traverse(Closure $callback) : $this
Parameters
$callback : Closure

The callable to apply to all nodes.

Tags
inheritDoc
Return values
$this

        
On this page

Search results