From 67b44edaf539245ca12789f19cca1e7a9437f4f3 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 12 Jan 2008 16:18:02 +0000 Subject: added raw_where() and raw_or_where() into AR --- system/database/DB_active_rec.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'system') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index b9594050e..683ded0a7 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -206,6 +206,44 @@ class CI_DB_active_record extends CI_DB_driver { // -------------------------------------------------------------------- + /** + * Raw Where + * + * Generates an unfiltered WHERE portion of the query. + * Separates multiple calls with AND + * + * @access public + * @param string + * @return string + */ + function raw_where($statement) + { + $prefix = (count($this->ar_where) == 0) ? '' : ' AND '; + $this->ar_where[] = $prefix.$statement; + return $statement; + } + + // -------------------------------------------------------------------- + + /** + * Raw OR Where + * + * Generates an unfiltered WHERE portion of the query. + * Separates multiple calls with OR + * + * @access public + * @param string + * @return string + */ + function raw_or_where($statement) + { + $prefix = (count($this->ar_where) == 0) ? '' : ' OR '; + $this->ar_where[] = $prefix.$statement; + return $statement; + } + + // -------------------------------------------------------------------- + /** * Where * -- cgit v1.2.3-24-g4f1b