CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.7 Red Velvet API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 3.7
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 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

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
      • Dialect
      • Driver
      • Exception
      • Expression
      • Log
      • Retry
      • Schema
      • Statement
      • Type
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class ValueBinder

Value binder class manages list of values bound to conditions.

Namespace: Cake\Database

Property Summary

  • $_bindings protected
    array

    Array containing a list of bound values to the conditions on this object. Each array entry is another array structure containing the actual bound value, its type and the placeholder it is bound to.

  • $_bindingsCount protected
    int

    A counter of the number of parameters bound in this expression object

Method Summary

  • attachTo() public

    Binds all the stored values in this object to the passed statement.

  • bind() public

    Associates a query placeholder to a value and a type

  • bindings() public

    Returns all values bound to this expression object at this nesting level. Subexpression bound values will not be returned with this function.

  • generateManyNamed() public

    Creates unique named placeholders for each of the passed values and binds them with the specified type.

  • placeholder() public

    Creates a unique placeholder name if the token provided does not start with ":" otherwise, it will return the same string and internally increment the number of placeholders generated by this object.

  • reset() public

    Clears any bindings that were previously registered

  • resetCount() public

    Resets the bindings count without clearing previously bound values

Method Detail

attachTo() ¶ public

attachTo(Cake\Database\StatementInterface $statement): void

Binds all the stored values in this object to the passed statement.

Parameters
Cake\Database\StatementInterface $statement

The statement to add parameters to.

Returns
void

bind() ¶ public

bind(string|int $param, mixed $value, string|int $type = 'string'): void

Associates a query placeholder to a value and a type

Parameters
string|int $param

placeholder to be replaced with quoted version of $value

mixed $value

The value to be bound

string|int $type optional

the mapped type name, used for casting when sending to database

Returns
void

bindings() ¶ public

bindings(): array

Returns all values bound to this expression object at this nesting level. Subexpression bound values will not be returned with this function.

Returns
array

generateManyNamed() ¶ public

generateManyNamed(array|Traversable $values, string $type = 'string'): array

Creates unique named placeholders for each of the passed values and binds them with the specified type.

Parameters
array|Traversable $values

The list of values to be bound

string $type optional

The type with which all values will be bound

Returns
array

placeholder() ¶ public

placeholder(string $token): string

Creates a unique placeholder name if the token provided does not start with ":" otherwise, it will return the same string and internally increment the number of placeholders generated by this object.

Parameters
string $token

string from which the placeholder will be derived from, if it starts with a colon, then the same string is returned

Returns
string

reset() ¶ public

reset(): void

Clears any bindings that were previously registered

Returns
void

resetCount() ¶ public

resetCount(): void

Resets the bindings count without clearing previously bound values

Returns
void

Property Detail

$_bindings ¶ protected

Array containing a list of bound values to the conditions on this object. Each array entry is another array structure containing the actual bound value, its type and the placeholder it is bound to.

Type
array

$_bindingsCount ¶ protected

A counter of the number of parameters bound in this expression object

Type
int
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs