diff options
author | Jamie Matthews <[email protected]> | 2010-10-07 01:31:05 +0100 |
---|---|---|
committer | Jamie Matthews <[email protected]> | 2010-10-07 01:31:05 +0100 |
commit | 69bf5735df7360264ad1763fc5bc303411bd8f6c (patch) | |
tree | b4ffbbc8a36380602bbfa38418c85491515dedc6 /idiorm.php | |
parent | 6c9356097dd42cdbc85481a40b7ecd2ce4d3f146 (diff) |
Simplify where_raw method. This method can now be used in method chains.
Diffstat (limited to 'idiorm.php')
-rw-r--r-- | idiorm.php | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -104,15 +104,6 @@ // Array of WHERE clauses protected $_where_conditions = array(); - // Is the WHERE clause raw? - protected $_where_is_raw = false; - - // Raw WHERE clause - protected $_raw_where_clause = ''; - - // Raw WHERE parameters - protected $_raw_where_parameters = array(); - // LIMIT protected $_limit = null; @@ -425,10 +416,7 @@ * to the parameters supplied in the second argument. */ public function where_raw($clause, $parameters) { - $this->_where_is_raw = true; - $this->_raw_where_clause = $clause; - $this->_raw_where_parameters = $parameters; - return $this; + return $this->_add_where($clause, $parameters); } /** @@ -511,13 +499,6 @@ * Build the WHERE clause(s) */ protected function _build_where() { - // If the WHERE clause is raw, just set $this->_values to - // the raw parameters and return the raw clause. - if ($this->_where_is_raw) { - $this->_values = array_merge($this->_values, $this->_raw_where_parameters); - return "WHERE " . $this->_raw_where_clause; - } - // If there are no WHERE clauses, return empty string if (count($this->_where_conditions) === 0) { return ''; |