Skip to content
Permalink
Browse files

Documenting more functions in Query

  • Loading branch information...
lorenzo committed Feb 9, 2013
1 parent 021157f commit b627aff3d27c9a76af45e131626aa1f3453cc277
Showing with 25 additions and 1 deletion.
  1. +25 −1 lib/Cake/Model/Datasource/Database/Query.php
@@ -1175,13 +1175,30 @@ public function decorateResults($callback, $overwrite = false) {
return $this;
}
/**
* Auxiliary function used to wrap the original statement from the driver with
* any registered callbacks.
*
* @param Cake\Model\Datasource\Database\Statement $statement to be decorated
* @return Cake\Model\Datasource\Database\Statement\CallbackStatement
*/
protected function _decorateResults($statement) {
foreach ($this->_resultDecorators as $f) {
$statement = new CallbackStatement($statement, $this->connection()->driver(), $f);
}
return $statement;
}
/**
* Helper function used to build conditions by composing QueryExpression objects
*
* @param string name of the query part to append the new part to
* @param string|array|Expression|callback $append
* @param sttring $conjunction type of conjunction to be used to operate part
* @param array $types associative array of type names used to bind values to query
* @return void
*/
protected function _conjugate($part, $append, $conjunction, $types) {
$expression = $this->_parts[$part] ?: $this->newExpr();
@@ -1201,6 +1218,13 @@ protected function _conjugate($part, $append, $conjunction, $types) {
$this->_dirty = true;
}
/**
* Traverses all QueryExpression objects stored in every relevant for this type
* of query and binds every value to the statement object for each placeholder.
*
* @param Cake\Model\Datasource\Database\Statement $statement
* @return void
*/
protected function _bindParams($statement) {
$visitor = function($expression) use ($statement) {
$params = $types = [];
@@ -1242,7 +1266,7 @@ protected function _bindParams($statement) {
* Returns a query object as returned by the connection object as a result of
* transforming this query instance to conform to any dialect specifics
*
* @return void
* @return Query
*/
protected function _transformQuery() {
if (isset($this->_transformedQuery) && !$this->_dirty) {

0 comments on commit b627aff

Please sign in to comment.
You can’t perform that action at this time.