diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-12-22 13:50:52 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-12-22 13:50:52 -0800 |
commit | 0650109d4bb5442cd77fcda61745dab67a632836 (patch) | |
tree | d2afe8cfb857dcb58764c96e467edbd68c73ee02 /modules/kohana23_compat | |
parent | 7118f84aa9ae0ece97a41aba4e4d269a1e136df6 (diff) |
Add merge_or_where() to MY_Datatabase_Builder and use that instead of
or_where() for compatibility and convenience. Caught by failing unit
tests.
Diffstat (limited to 'modules/kohana23_compat')
-rw-r--r-- | modules/kohana23_compat/libraries/MY_Database_Builder.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/kohana23_compat/libraries/MY_Database_Builder.php b/modules/kohana23_compat/libraries/MY_Database_Builder.php index 54a10860..c82b6ac4 100644 --- a/modules/kohana23_compat/libraries/MY_Database_Builder.php +++ b/modules/kohana23_compat/libraries/MY_Database_Builder.php @@ -29,6 +29,17 @@ class Database_Builder extends Database_Builder_Core { return $this; } + /** + * Merge in a series of where clause tuples and call or_where() on each one. + * @chainable + */ + public function merge_or_where($tuples) { + foreach ($tuples as $tuple) { + $this->or_where($tuple[0], $tuple[1], $tuple[2]); + } + return $this; + } + public function compile() { return parent::compile(); } |