Created
June 7, 2013 18:37
-
-
Save mishudark/5731402 to your computer and use it in GitHub Desktop.
Get SQL from FIND model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/core/lib/Cake/Model/Datasource/DboSource.php b/core/lib/Cake/Model/Datasource/DboSource.php | |
| index 57368b4..f17a658 100755 | |
| --- a/core/lib/Cake/Model/Datasource/DboSource.php | |
| +++ b/core/lib/Cake/Model/Datasource/DboSource.php | |
| @@ -1026,7 +1026,7 @@ class DboSource extends DataSource { | |
| * @param integer $recursive Number of levels of association | |
| * @return mixed boolean false on error/failure. An array of results on success. | |
| */ | |
| - public function read(Model $model, $queryData = array(), $recursive = null) { | |
| + public function read(Model $model, $queryData = array(), $recursive = null, $sql = null) { | |
| $queryData = $this->_scrubQueryData($queryData); | |
| $null = null; | |
| @@ -1076,6 +1076,7 @@ class DboSource extends DataSource { | |
| } | |
| $query = trim($this->generateAssociationQuery($model, null, null, null, null, $queryData, false, $null)); | |
| + if($sql) return $query; | |
| $resultSet = $this->fetchAll($query, $model->cacheQueries); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment