mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing some duplicate code
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4825 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
95e2782d72
commit
cff6ea0ee8
1 changed files with 6 additions and 14 deletions
|
@ -1084,9 +1084,6 @@ class DboSource extends DataSource {
|
|||
}
|
||||
|
||||
function buildStatement($query, $model) {
|
||||
if(isset($query['in'])) {
|
||||
return $this->renderInStatement($query, $model);
|
||||
}
|
||||
$query = am(array('offset' => null, 'joins' => array()), $query);
|
||||
if (!empty($query['joins'])) {
|
||||
for ($i = 0; $i < count($query['joins']); $i++) {
|
||||
|
@ -1095,6 +1092,12 @@ class DboSource extends DataSource {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($query['in'])) {
|
||||
$query['conditions'] = $query['in'];
|
||||
return $this->renderInStatement($query, $model);
|
||||
}
|
||||
|
||||
return $this->renderStatement(array(
|
||||
'conditions' => $this->conditions($query['conditions']),
|
||||
'fields' => join(', ', $query['fields']),
|
||||
|
@ -1107,17 +1110,6 @@ class DboSource extends DataSource {
|
|||
}
|
||||
|
||||
function renderInStatement($query, $model) {
|
||||
if(isset($query['in'])) {
|
||||
$query['conditions'] = $query['in'];
|
||||
}
|
||||
$query = am(array('offset' => null, 'joins' => array()), $query);
|
||||
if (!empty($query['joins'])) {
|
||||
for ($i = 0; $i < count($query['joins']); $i++) {
|
||||
if (is_array($query['joins'][$i])) {
|
||||
$query['joins'][$i] = $this->buildJoinStatement($query['joins'][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$replace[] = '{$__cakeID__$}';
|
||||
$replace[] = $this->renderStatement(array(
|
||||
'conditions' => $this->conditions($query['conditions']),
|
||||
|
|
Loading…
Reference in a new issue