From 1e7a269f546c9e56026af46543ed5889af9b80d4 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 17 Mar 2006 17:01:48 +0000 Subject: [PATCH] For set_condition() you can now send an array of fields to use --- api.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/api.php b/api.php index cddd2d7..4e7a2c5 100644 --- a/api.php +++ b/api.php @@ -296,7 +296,7 @@ class API * * @access public * - * @param string WHERE conditional bit + * @param mixed String with WHERE condition; array of fields to use for WHERE builder */ function set_condition($condition = '') { @@ -304,6 +304,22 @@ class API { $this->condition = $condition; } + else if (sizeof($condition) > 0) + { + $this->condition = ''; + + foreach ($condition AS $field) + { + if (!$this->values["$field"]) + { + trigger_error('The specified field `' . $field . . '` for the condition could not be found as it is not set', E_USER_WARNING); + continue; + } + + $condbits[] = "$field = " . $this->prepare_field_for_sql($name); + } + $this->condition = implode(' AND ', $condbits); + } else { foreach ($this->fields AS $name => $options) -- 2.43.5