From cff6ea0ee805447aaad9519ff0c748179794cbfa Mon Sep 17 00:00:00 2001 From: phpnut Date: Mon, 9 Apr 2007 04:05:22 +0000 Subject: [PATCH] Removing some duplicate code git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4825 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo_source.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 20666886f..2732d2636 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -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']),