Skip to content

Commit

Permalink
Remove unused $resultSet argument from generateAssociationQuery().
Browse files Browse the repository at this point in the history
  • Loading branch information
bar committed Nov 12, 2013
1 parent 5da05d9 commit 53c6df5
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 112 deletions.
12 changes: 5 additions & 7 deletions lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -1056,7 +1056,6 @@ public function read(Model $model, $queryData = array(), $recursive = null) {

// Generate hasOne and belongsTo associations inside $queryData
$linkedModels = array();
$null = null;
foreach ($_associations as $type) {
if ($type !== 'hasOne' && $type !== 'belongsTo') {
continue;
Expand All @@ -1073,14 +1072,14 @@ public function read(Model $model, $queryData = array(), $recursive = null) {
if ($bypass) {
$assocData['fields'] = false;
}
if ($this->generateAssociationQuery($model, $linkModel, $type, $assoc, $assocData, $queryData, $external, $null) === true) {
if ($this->generateAssociationQuery($model, $linkModel, $type, $assoc, $assocData, $queryData, $external) === true) {
$linkedModels[$type . '/' . $assoc] = true;
}
}
}

// Build SQL statement with the primary model, plus hasOne and belongsTo associations
$query = $this->generateAssociationQuery($model, null, null, null, null, $queryData, false, $null);
$query = $this->generateAssociationQuery($model, null, null, null, null, $queryData, false);
$resultSet = $this->fetchAll($query, $model->cacheQueries);
unset($query);

Expand Down Expand Up @@ -1204,7 +1203,7 @@ public function queryAssociation(Model $model, &$linkModel, $type, $association,
unset($stack['_joined']);
}

if (!$query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
if (!$query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external)) {
return;
}

Expand Down Expand Up @@ -1513,11 +1512,10 @@ protected function _mergeAssociation(&$data, &$merge, $association, $type, $self
* @param string $association
* @param array $assocData
* @param array $queryData
* @param boolean $external
* @param array $resultSet
* @param boolean $external Whether or not the association query is on an external datasource.
* @return mixed
*/
public function generateAssociationQuery(Model $model, $linkModel, $type, $association, $assocData, &$queryData, $external, &$resultSet) {
public function generateAssociationQuery(Model $model, $linkModel, $type, $association, $assocData, &$queryData, $external) {
$queryData = $this->_scrubQueryData($queryData);
$assocData = $this->_scrubQueryData($assocData);
$modelAlias = $model->alias;
Expand Down

0 comments on commit 53c6df5

Please sign in to comment.