No longer populate API->values[] in fetch()
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 28 May 2006 00:33:03 +0000 (00:33 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 28 May 2006 00:33:03 +0000 (00:33 +0000)
api.php
dev/changes.txt

diff --git a/api.php b/api.php
index 058f98b0d21f905f319432a2e381e8b3de1c6f21..4dbbf1faa9dd506625178b98701504bc3070c79c 100644 (file)
--- 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;
+                               }
                        }
                }
                
index cb8bd8214194df5270d4ac0c242015e2d8a7aa23..ac34191619d79ebfdf333d0f0086008f43c93a32 100644 (file)
@@ -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
 ===============