CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • BetweenExpression
  • CaseExpression
  • Comparison
  • FunctionExpression
  • IdentifierExpression
  • OrderByExpression
  • OrderClauseExpression
  • QueryExpression
  • TupleComparison
  • UnaryExpression
  • ValuesExpression

Interfaces

  • FieldInterface

Traits

  • FieldTrait

Class TupleComparison

This expression represents SQL fragments that are used for comparing one tuple to another, one tuple to a set of other tuples or one tuple to an expression

Cake\Database\Expression\Comparison implements Cake\Database\ExpressionInterface, Cake\Database\Expression\FieldInterface uses Cake\Database\Type\ExpressionTypeCasterTrait , Cake\Database\Expression\FieldTrait
Extended by Cake\Database\Expression\TupleComparison
Namespace: Cake\Database\Expression
Location: Database/Expression/TupleComparison.php

Inherited Properties

  • _isMultiple, _operator, _type, _value, _valueExpressions _field

Method Summary

  • __construct() public
    Constructor
  • _bindValue() protected

    Registers a value in the placeholder generator and returns the generated placeholder

  • _stringifyValues() protected

    Returns a string with the values as placeholders in a string to be used for the SQL version of this expression

  • _traverseValue() protected

    Conditionally executes the callback for the passed value if it is an ExpressionInterface

  • isMulti() public

    Determines if each of the values in this expressions is a tuple in itself

  • sql() public
    Convert the expression into a SQL fragment.
  • traverse() public

    Traverses the tree of expressions stored in this object, visiting first expressions in the left hand side and then the rest.

Method Detail

__construct() public ¶

__construct( string|array|Cake\Database\ExpressionInterface $fields , array|Cake\Database\ExpressionInterface $values , array $types = [] , string $conjunction = '=' )

Constructor

Parameters
string|array|Cake\Database\ExpressionInterface $fields
the fields to use to form a tuple
array|Cake\Database\ExpressionInterface $values
the values to use to form a tuple
array $types optional []

the types names to use for casting each of the values, only one type per position in the value array in needed

string $conjunction optional '='
the operator used for comparing field and value
Overrides
Cake\Database\Expression\Comparison::__construct()

_bindValue() protected ¶

_bindValue( Cake\Database\ValueBinder $generator , mixed $value , string $type )

Registers a value in the placeholder generator and returns the generated placeholder

Parameters
Cake\Database\ValueBinder $generator
The value binder
mixed $value
The value to bind
string $type
The type to use
Returns
string
generated placeholder
Overrides
Cake\Database\Expression\Comparison::_bindValue()

_stringifyValues() protected ¶

_stringifyValues( Cake\Database\ValueBinder $generator )

Returns a string with the values as placeholders in a string to be used for the SQL version of this expression

Parameters
Cake\Database\ValueBinder $generator
The value binder to convert expressions with.
Returns
string

_traverseValue() protected ¶

_traverseValue( mixed $value , callable $callable )

Conditionally executes the callback for the passed value if it is an ExpressionInterface

Parameters
mixed $value
The value to traverse
callable $callable
The callable to use when traversing

isMulti() public ¶

isMulti( )

Determines if each of the values in this expressions is a tuple in itself

Returns
boolean

sql() public ¶

sql( Cake\Database\ValueBinder $generator )

Convert the expression into a SQL fragment.

Parameters
Cake\Database\ValueBinder $generator
Placeholder generator object
Returns
string
Overrides
Cake\Database\Expression\Comparison::sql()

traverse() public ¶

traverse( callable $callable )

Traverses the tree of expressions stored in this object, visiting first expressions in the left hand side and then the rest.

Callback function receives as its only argument an instance of an ExpressionInterface

Parameters
callable $callable
The callable to apply to sub-expressions
Overrides
Cake\Database\Expression\Comparison::traverse()

Methods inherited from Cake\Database\Expression\Comparison

__clone() public ¶

__clone( )

Create a deep clone.

Clones the field and value if they are expression objects.

_collectExpressions() protected ¶

_collectExpressions( array|Traversable $values )

Returns an array with the original $values in the first position and all ExpressionInterface objects that could be found in the second position.

Parameters
array|Traversable $values
The rows to insert
Returns
array

_flattenValue() protected ¶

_flattenValue( array|Traversable $value , Cake\Database\ValueBinder $generator , string|array|null $type = 'string' )

Converts a traversable value into a set of placeholders generated by $generator and separated by ,

Parameters
array|Traversable $value
the value to flatten
Cake\Database\ValueBinder $generator
The value binder to use
string|array|null $type optional 'string'
the type to cast values to
Returns
string

_stringExpression() protected ¶

_stringExpression( Cake\Database\ValueBinder $generator )

Returns a template and a placeholder for the value after registering it with the placeholder $generator

Parameters
Cake\Database\ValueBinder $generator
The value binder to use.
Returns
array
First position containing the template and the second a placeholder

getOperator() public ¶

getOperator( )

Returns the operator used for comparison

Returns
string

getValue() public ¶

getValue( )

Returns the value used for comparison

Returns
mixed

setOperator() public ¶

setOperator( string $operator )

Sets the operator to use for the comparison

Parameters
string $operator
The operator to be used for the comparison.

setValue() public ¶

setValue( mixed $value )

Sets the value

Parameters
mixed $value
The value to compare

Methods used from Cake\Database\Type\ExpressionTypeCasterTrait

_castToExpression() protected ¶

_castToExpression( mixed $value , string $type )

Conditionally converts the passed value to an ExpressionInterface object if the type class implements the ExpressionTypeInterface. Otherwise, returns the value unmodified.

Parameters
mixed $value
The value to converto to ExpressionInterface
string $type
The type name
Returns
mixed

_requiresToExpressionCasting() protected ¶

_requiresToExpressionCasting( array $types )

Returns an array with the types that require values to be casted to expressions, out of the list of type names passed as parameter.

Parameters
array $types
List of type names
Returns
array

Methods used from Cake\Database\Expression\FieldTrait

getField() public ¶

getField( )

Returns the field name

Returns
string|Cake\Database\ExpressionInterface

setField() public ¶

setField( string|Cake\Database\ExpressionInterface $field )

Sets the field name

Parameters
string|Cake\Database\ExpressionInterface $field
The field to compare with.
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs