Horde_Xml_Element::lookupNamespace PHP Method

lookupNamespace() public static method

Looks up a prefix (atom:, etc.) in the list of registered namespaces and returns the full namespace URI if available. Returns the prefix, unmodified, if it's not registered.
public static lookupNamespace ( $prefix ) : string
return string
    public static function lookupNamespace($prefix)
    {
        return isset(self::$_namespaces[$prefix]) ? self::$_namespaces[$prefix] : $prefix;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Required by the ArrayAccess interface.
  *
  * @internal
  */
 public function offsetUnset($offset)
 {
     if (strpos($offset, ':') !== false) {
         list($ns, $attr) = explode(':', $offset, 2);
         $result = $this->_element->removeAttributeNS(Horde_Xml_Element::lookupNamespace($ns), $attr);
     } else {
         $result = $this->_element->removeAttribute($offset);
     }
     if ($result) {
         $this->_expireCachedChildren();
         return true;
     } else {
         return false;
     }
 }