Class xPDOCriteria

Direct descendents

Child Class Description
xPDOQuery An xPDOCriteria derivative with methods for constructing complex statements.

[ Top ]

Property Summary

mixed   $bindings  
mixed   $cacheFlag  
mixed   $sql  
mixed   $stmt  

[ Top ]

Method Summary

xPDOCriteria   __construct()   Creates a new xPDOCriteria instance.
xPDOCriteria   xPDOCriteria()  
void   bind()   Binds an array of key/value pairs to the xPDOCriteria prepared statement.
boolean   equals()   Compares to see if two xPDOCriteria instances are the same.
void   prepare()  

[ Top ]

Properties

mixed   $bindings = array () [line 1352]

[ Top ]
mixed   $cacheFlag = false [line 1353]

[ Top ]
mixed   $sql = '' [line 1350]

[ Top ]
mixed   $stmt = null [line 1351]

[ Top ]

Methods

Constructor __construct  [line 1379]

  xPDOCriteria __construct( &$xpdo, [string $sql = ''], [array $bindings = array ()], [boolean|integer $cacheFlag = false]  )

Creates a new xPDOCriteria instance.

The constructor optionally prepares provided SQL and/or parameter bindings. Setting the bindings via the constructor or with the xPDOCriteria::bind() function allows you to make use of the data object caching layer.

Parameters:
string   $sql:  The SQL statement.
array   $bindings:  Bindings to bind to the criteria.
boolean|integer   $cacheFlag:  Indicates if the result set from the criteria is to be cached (true|false) and how long it will live in cache in seconds.
   &$xpdo: 

Information Tags:
Todo:  Refactor this so you can get an xPDOCriteria instance without calling the prepare and bind methods explicitly. In this way, the criteria can be constructed without the database connection required. Without this, every request will require a database connection before even looking at the object/result set cache.

Redefined in descendants as:

[ Top ]
Constructor xPDOCriteria  [line 1355]

  xPDOCriteria xPDOCriteria( &$xpdo, [ $sql = ''], [ $bindings = array ()], [ $cacheFlag = false]  )

Parameters:
   &$xpdo: 
   $sql: 
   $bindings: 
   $cacheFlag: 


[ Top ]
bind  [line 1410]

  void bind( [array $bindings = array ()], [boolean $byValue = true], [boolean|integer $cacheFlag = false]  )

Binds an array of key/value pairs to the xPDOCriteria prepared statement.

Use this method to bind parameters in a way that makes it possible to cache results of previous executions of the criteria or compare the criteria to other individual or collections of criteria.

Parameters:
array   $bindings:  Bindings to merge with any existing bindings defined for this xPDOCriteria instance. Bindings can be simple associative array of key-value pairs or the value for each key can contain elements titled value, type, and length corresponding to the appropriate parameters in the PDOStatement::bindValue() and PDOStatement::bindParam() functions.
boolean   $byValue:  Determines if the $bindings are to be bound as parameters (by variable reference, the default behavior) or by direct value (if true).
boolean|integer   $cacheFlag:  The cacheFlag indicates the cache state of the xPDOCriteria object and can be absolutely off (false), absolutely


[ Top ]
equals  [line 1444]

  boolean equals( object $obj  )

Compares to see if two xPDOCriteria instances are the same.

Parameters:
object   $obj:  A xPDOCriteria object to compare to this one.

API Tags:
Return:  true if they are both equal is SQL and bindings, otherwise false.


[ Top ]
prepare  [line 1448]

  void prepare( )



Redefined in descendants as:

[ Top ]