Horde_Config::_getEnumValues PHP Method

_getEnumValues() protected method

The keys contain the actual enum values while the values contain their corresponding descriptions.
protected _getEnumValues ( DomNode $node ) : array
$node DomNode The DomNode representation of the tag whose values should be returned.
return array An associative array with all possible enum values.
    protected function _getEnumValues($node)
    {
        $values = array();
        if (!$node->hasChildNodes()) {
            return $values;
        }
        foreach ($node->childNodes as $vnode) {
            if ($vnode->nodeType == XML_ELEMENT_NODE && $vnode->tagName == 'values') {
                if (!$vnode->hasChildNodes()) {
                    return array();
                }
                foreach ($vnode->childNodes as $value) {
                    if ($value->nodeType == XML_ELEMENT_NODE) {
                        if ($value->tagName == 'configspecial') {
                            return $this->_handleSpecials($value);
                        }
                        if ($value->tagName == 'value') {
                            $text = $value->textContent;
                            $desc = $value->getAttribute('desc');
                            $values[$text] = empty($desc) ? $text : $desc;
                        }
                    }
                }
            }
        }
        return $values;
    }