diff options
author | Evan Prodromou <evan@status.net> | 2010-01-06 23:34:59 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-06 23:34:59 -0800 |
commit | b2bab7d7caddd7e57974e07c48663e1422853ebe (patch) | |
tree | 8ed077e3cbcab8d24022601102ead59ae27f2d3b | |
parent | f4fa785fb7cf6f222f77ad81f6a1e50e5af7fdf3 (diff) |
fixup keytypes so it returns the types no matter what kind of class it is
-rw-r--r-- | classes/Memcached_DataObject.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 4e3cc5678..400b05f97 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(); |