Skip to content

Commit

Permalink
Documenting more functions in Query
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 9, 2013
1 parent 021157f commit b627aff
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion lib/Cake/Model/Datasource/Database/Query.php
Expand Up @@ -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();

Expand All @@ -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 = [];
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b627aff

Please sign in to comment.