From 89de42a44b6672e6e33909eff654e20be99a5cd3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 28 May 2006 00:33:03 +0000 Subject: [PATCH] No longer populate API->values[] in fetch() --- api.php | 13 +++++++++---- dev/changes.txt | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api.php b/api.php index 058f98b..4dbbf1f 100644 --- a/api.php +++ b/api.php @@ -374,9 +374,11 @@ class API /** * Fetches a record based on the condition * + * @param bool Populate $this->values[] with data, along with $this->objdata[] ? + * * @access public */ - function fetch() + function fetch($populate = false) { if ($this->condition == '') { @@ -396,11 +398,14 @@ class API $this->objdata = $result; - foreach ($this->objdata AS $key => $value) + if ($populate) { - if (!isset($this->values["$key"])) + foreach ($this->objdata AS $key => $value) { - $this->values["$key"] = $value; + if (!isset($this->values["$key"])) + { + $this->values["$key"] = $value; + } } } diff --git a/dev/changes.txt b/dev/changes.txt index cb8bd82..ac34191 100644 --- a/dev/changes.txt +++ b/dev/changes.txt @@ -3,6 +3,7 @@ - Added TYPE_NONE as an alias for TYPE_NOCLEAN - Added TYPE_BIN to create a macro in the API that will escape the string as binary, instead of a string - DB_MySQL can now properly escape binary +- No longer populate API->values[] when calling API->fetch() [api.php] 2.0.0 =============== -- 2.22.5