Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bar committed Dec 21, 2013
1 parent a7ecf44 commit 1bdb783
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -1028,7 +1028,7 @@ public function create(Model $Model, $fields = null, $values = null) {
* Reads record(s) from the database.
*
* @param Model $Model A Model object that the query is for.
* @param array $queryData An array of queryData information containing keys similar to Model::find()
* @param array $queryData An array of queryData information containing keys similar to Model::find().
* @param integer $recursive Number of levels of association
* @return mixed boolean false on error/failure. An array of results on success.
*/
Expand Down Expand Up @@ -1194,11 +1194,11 @@ protected function _filterResults(&$results, Model $Model, $filtered = array())
/**
* Queries associations. Used to fetch results on recursive models.
*
* @param Model $Model Primary Model object
* @param Model $LinkModel Linked model that
* @param Model $Model Primary Model object.
* @param Model $LinkModel Linked model object.
* @param string $type Association type, one of the model association types ie. hasMany
* @param string $association
* @param array $assocData
* @param string $association Association name.
* @param array $assocData Association data.
* @param array $queryData
* @param boolean $external Whether or not the association query is on an external datasource.
* @param array $resultSet Existing results
Expand Down Expand Up @@ -1514,7 +1514,7 @@ protected function _mergeAssociation(&$data, &$merge, $association, $type, $self
* When no fields are set, all the $Model fields are returned.
*
* @param Model $Model
* @param array $queryData
* @param array $queryData Query data already processed.
* @return array Array containing SQL fields.
*/
public function prepareFields(Model $Model, $queryData) {
Expand Down Expand Up @@ -1543,7 +1543,7 @@ public function prepareFields(Model $Model, $queryData) {
* This is merely a convenient wrapper to DboSource::buildStatement().
*
* @param Model $Model
* @param array $queryData
* @param array $queryData Query data already processed.
* @return string String containing an SQL statement.
* @see DboSource::buildStatement()
*/
Expand All @@ -1569,12 +1569,14 @@ public function buildAssociationQuery(Model $Model, $queryData) {
/**
* Generates an array representing a query or part of a query from a single model or two associated models.
*
* @param Model $Model
* @param Model $LinkModel
* Builds a string containing an SQL statement template.
*
* @param Model $Model Primary Model object.
* @param Model $LinkModel Linked model object.
* @param string $type Association type, one of the model association types ie. hasMany
* @param string $association
* @param array $assocData
* @param array $queryData
* @param array $assocData Association data.
* @param array $queryData Query data already processed.
* @param boolean $external Whether or not the association query is on an external datasource.
* @return mixed
* True. when $external is false and association $type is 'hasOne' or 'belongsTo'.
Expand Down Expand Up @@ -1764,10 +1766,10 @@ public function getConstraint($type, Model $Model, $linkModel, $alias, $assoc, $
}

/**
* Builds and generates a JOIN statement from an array. Handles final clean-up before conversion.
* Builds and generates a JOIN condition from an array. Handles final clean-up before conversion.
*
* @param array $join An array defining a JOIN statement in a query
* @return string An SQL JOIN statement to be used in a query
* @param array $join An array defining a JOIN condition in a query.
* @return string An SQL JOIN condition to be used in a query.
* @see DboSource::renderJoinStatement()
* @see DboSource::buildStatement()
*/
Expand Down Expand Up @@ -2055,15 +2057,17 @@ protected function _matchRecords(Model $Model, $conditions = null) {
if (empty($idList)) {
return false;
}

$conditions = $this->conditions(array(
$Model->primaryKey => Hash::extract($idList, "{n}.{$Model->alias}.{$Model->primaryKey}")
));
}

return $conditions;
}

/**
* Returns an array of SQL JOIN fragments from a model's associations
* Returns an array of SQL JOIN conditions from a model's associations.
*
* @param Model $Model
* @return array
Expand Down

0 comments on commit 1bdb783

Please sign in to comment.