From: Evan Prodromou Date: Thu, 7 Jan 2010 07:34:59 +0000 (-0800) Subject: fixup keytypes so it returns the types no matter what kind of class it is X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b2bab7d7caddd7e57974e07c48663e1422853ebe;p=quix0rs-gnu-social.git fixup keytypes so it returns the types no matter what kind of class it is --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 4e3cc56788..400b05f977 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -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();