/** Retrieves all options for a given type
* @param $type Type of enum for which options are requested
* @return XorgDbIterator over the results
- * TODO : Find a way to get either an array, or the adequate PlIterator
*/
static public function getOptions()
{
return call_user_func_array(array($obj, 'getOptions'), $args);
}
+ /** Retrieves all options for a given type
+ * @param $type Type of enum for which options are requested
+ * @return Array of the results the results
+ */
+ static public function getOptionsArray()
+ {
+ $args = func_get_args();
+ $type = array_shift($args);
+ if (!array_key_exists($type, self::$enumerations)) {
+ self::init($type);
+ }
+ $obj = self::$enumerations[$type];
+ return call_user_func_array(array($obj, 'getOptionsArray'), $args);
+ }
+
/** Retrieves all options with number of profiles for autocompletion
* @param $type Type of enum for which options are requested
* @param $text Text to autocomplete
return $this->options;
}
+ public function getOptionsArray()
+ {
+ $this->_fetchOptions();
+ $options = array();
+ while ($row = $this->options->next()) {
+ $options[$row['id']] = $row['field'];
+ }
+ return $options;
+ }
+
// {{{ function getIDs
/** Retrieves possible IDs for given text
* @param $text Text to search for IDs