]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fixup keytypes so it returns the types no matter what kind of class it is
authorEvan Prodromou <evan@status.net>
Thu, 7 Jan 2010 07:34:59 +0000 (23:34 -0800)
committerEvan Prodromou <evan@status.net>
Thu, 7 Jan 2010 07:34:59 +0000 (23:34 -0800)
classes/Memcached_DataObject.php

index 4e3cc5678867d26e6d2f6cf47b9cf1b9b1a51433..400b05f9776fca066e462e3a812a2a37fc08f7a6 100644 (file)
@@ -194,6 +194,17 @@ class Memcached_DataObject extends DB_DataObject
 
     function keyTypes()
     {
+        // ini-based classes return number-indexed arrays. handbuilt
+        // classes return column => keytype. Make this uniform.
+
+        $keys = $this->keys();
+
+        $keyskeys = array_keys($keys);
+
+        if (is_string($keyskeys[0])) {
+            return $keys;
+        }
+
         global $_DB_DATAOBJECT;
         if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) {
             $this->databaseStructure();