Use getAssoc() here.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 26 Jan 2009 19:46:59 +0000 (14:46 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 26 Jan 2009 19:51:05 +0000 (14:51 -0500)
content/lib/Types/Manager.php

index 62b4bc8..c34d766 100644 (file)
@@ -72,10 +72,10 @@ class Content_Types_Manager
 
         // Get the ids for any types that already exist.
         if (count($typeName)) {
-            foreach ($this->_db->selectAll('SELECT type_id, type_name FROM ' . $this->_t('types') . ' WHERE type_name IN ('.implode(',', array_map(array($this->_db, 'quote'), array_keys($typeName))).')') as $row) {
-                $typeIndex = $typeName[$row['type_name']];
-                unset($typeName[$row['type_name']]);
-                $typeIds[$typeIndex] = (int)$row['type_id'];
+            foreach ($this->_db->selectAssoc('SELECT type_id, type_name FROM ' . $this->_t('types') . ' WHERE type_name IN ('.implode(',', array_map(array($this->_db, 'quote'), array_keys($typeName))).')') as $id => $type) {
+                $typeIndex = $typeName[$type];
+                unset($typeName[$type]);
+                $typeIds[$typeIndex] = (int)$id;
             }
         }