Permalink
Browse files

Add documentation. Strict check.

  • Loading branch information...
1 parent 1bdb783 commit c1cdf190e3a2c98d7091d14b5449aaa39a15df17 @bar bar committed Dec 21, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/Cake/Model/Datasource/DboSource.php
@@ -1079,6 +1079,7 @@ public function read(Model $Model, $queryData = array(), $recursive = null) {
if ($bypass) {
$assocData['fields'] = false;
}
+
$external = isset($assocData['external']);
if ($this->generateAssociationQuery($Model, $LinkModel, $type, $assoc, $assocData, $queryData, $external) === true) {
@@ -1148,9 +1149,9 @@ public function read(Model $Model, $queryData = array(), $recursive = null) {
}
/**
- * Passes association results through afterFind filters of corresponding model.
+ * Passes association results through afterFind filters of the corresponding model.
*
- * The primary model is always filtered.
+ * The primary model is always excluded, because the filtering is later done by Model::_filterResults().
*
* @param array $results Reference of resultset to be filtered
* @param Model $Model Instance of model to operate against
@@ -1588,7 +1589,7 @@ public function generateAssociationQuery(Model $Model, Model $LinkModel, $type,
return $assocData['finderQuery'];
}
- if (in_array($type, array('hasMany', 'hasAndBelongsToMany'))) {
+ if ($type === 'hasMany' || $type === 'hasAndBelongsToMany') {
if (empty($assocData['offset']) && !empty($assocData['page'])) {
$assocData['offset'] = ($assocData['page'] - 1) * $assocData['limit'];
}
@@ -1603,7 +1604,7 @@ public function generateAssociationQuery(Model $Model, Model $LinkModel, $type,
);
if ($external) {
- // Self join
+ // Not self join
if ($Model->name !== $LinkModel->name) {
$modelAlias = $Model->alias;
foreach ($conditions as $key => $condition) {

0 comments on commit c1cdf19

Please sign in to comment.