PHP 클래스 Horde_Xml_Element, horde

저자: Chuck Hagenbuch ([email protected])
상속: implements ArrayAccess
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_appended boolean
$_children array
$_element DOMElement
$_namespaces array
$_parentElement Horde_Xml_Element
$_serialized string A string representation of the element, used when serializing/unserializing.

공개 메소드들

메소드 설명
__call ( string $var, $unused ) : mixed Get the value of an element with method syntax.
__construct ( $element ) Horde_Xml_Element constructor.
__get ( string $var ) : mixed Map variable access onto the underlying entry representation.
__isset ( $var ) Map isset calls onto the underlying entry representation.
__set ( string $var, string $val ) Map variable sets onto the underlying entry representation.
__sleep ( ) : array Prepare for serialization
__toString ( ) Returns the nodeValue of this element when this object is used in a string context.
__unset ( $var ) Remove all children matching $var.
__wakeup ( ) Unserialization handler; handles $this->_element being an instance of DOMElement or Horde_Xml_Element, or parses it as an XML string.
appendChild ( Horde_Xml_Element $element ) Append a child node to this element.
fromArray ( $array ) Add child elements and attributes to this element from a simple key => value hash. Keys can be:
getDom ( ) : DOMElement Get a DOM representation of the element
lookupNamespace ( $prefix ) : string Get the full version of a namespace prefix
offsetExists ( $offset ) Required by the ArrayAccess interface.
offsetGet ( $offset ) Required by the ArrayAccess interface.
offsetSet ( $offset, $value ) Required by the ArrayAccess interface.
offsetUnset ( $offset ) Required by the ArrayAccess interface.
registerNamespace ( string $prefix, string $namespaceURI ) Add a namespace and prefix to the registered list
saveXml ( $formatted = false ) : string Get an XML string representation of this element
saveXmlFragment ( $formatted = false ) : string Get the XML for only this element
setDom ( DOMElement $element ) Update the object from a DOM element
setParent ( Horde_Xml_Element $element ) Set the parent element of this object to another Horde_Xml_Element.

보호된 메소드들

메소드 설명
_cacheChildren ( ) Build a cache of child nodes.
_children ( $var ) : array Finds children with tagnames matching $var
_ensureAppended ( ) Appends this element to its parent if necessary.
_expireCachedChildren ( ) Expire cached children.

메소드 상세

__call() 공개 메소드

Map method calls to get the string value of the requested element. If there are multiple elements that match, this will return an array of those objects.
public __call ( string $var, $unused ) : mixed
$var string The element to get the string value of.
리턴 mixed The node's value, null, or an array of nodes.

__construct() 공개 메소드

Horde_Xml_Element constructor.
public __construct ( $element )

__get() 공개 메소드

Get-style access returns a Horde_Xml_Element representing the child element accessed. To get string values, use method syntax with the __call() overriding.
public __get ( string $var ) : mixed
$var string The property to access.
리턴 mixed

__isset() 공개 메소드

Map isset calls onto the underlying entry representation.
public __isset ( $var )

__set() 공개 메소드

Map variable sets onto the underlying entry representation.
public __set ( string $var, string $val )
$var string The property to change.
$val string The property's new value.

__sleep() 공개 메소드

Prepare for serialization
public __sleep ( ) : array
리턴 array

__toString() 공개 메소드

Returns the nodeValue of this element when this object is used in a string context.
public __toString ( )

__unset() 공개 메소드

Remove all children matching $var.
public __unset ( $var )

__wakeup() 공개 메소드

Unserialization handler; handles $this->_element being an instance of DOMElement or Horde_Xml_Element, or parses it as an XML string.
public __wakeup ( )

_cacheChildren() 보호된 메소드

Build a cache of child nodes.
protected _cacheChildren ( )

_children() 보호된 메소드

Similar to SimpleXML's children() method.
protected _children ( $var ) : array
리턴 array

_ensureAppended() 보호된 메소드

Appends this element to its parent if necessary.
protected _ensureAppended ( )

_expireCachedChildren() 보호된 메소드

Expire cached children.
protected _expireCachedChildren ( )

appendChild() 공개 메소드

Append a child node to this element.
public appendChild ( Horde_Xml_Element $element )
$element Horde_Xml_Element The element to append.

fromArray() 공개 메소드

ElementName -> <$ElementName> will be appended with a value of $value #AttributeName -> An attribute $AttributeName will be added to this element with a value of $value ElementName#AttributeName -> <$ElementName> will be appended to this element if it doesn't already exist, and have its attribute $AttributeName set to $value
public fromArray ( $array )
$array Hash to import into this element.

getDom() 공개 메소드

Returns the underlying DOM object, which can then be manipulated with full DOM methods.
public getDom ( ) : DOMElement
리턴 DOMElement

lookupNamespace() 공개 정적인 메소드

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
리턴 string

offsetExists() 공개 메소드

Required by the ArrayAccess interface.
public offsetExists ( $offset )

offsetGet() 공개 메소드

Required by the ArrayAccess interface.
public offsetGet ( $offset )

offsetSet() 공개 메소드

Required by the ArrayAccess interface.
public offsetSet ( $offset, $value )

offsetUnset() 공개 메소드

Required by the ArrayAccess interface.
public offsetUnset ( $offset )

registerNamespace() 공개 정적인 메소드

Takes a prefix and a full namespace URI and adds them to the list of registered namespaces for use by Horde_Xml_Element::lookupNamespace().
public static registerNamespace ( string $prefix, string $namespaceURI )
$prefix string The namespace prefix
$namespaceURI string The full namespace URI

saveXml() 공개 메소드

Returns a string of this element's XML, including the XML prologue.
public saveXml ( $formatted = false ) : string
리턴 string

saveXmlFragment() 공개 메소드

Returns a string of this element's XML without prologue.
public saveXmlFragment ( $formatted = false ) : string
리턴 string

setDom() 공개 메소드

Take a DOMElement object, which may be originally from a call to getDom() or may be custom created, and use it as the DOM tree for this Horde_Xml_Element.
public setDom ( DOMElement $element )
$element DOMElement

setParent() 공개 메소드

Set the parent element of this object to another Horde_Xml_Element.
public setParent ( Horde_Xml_Element $element )
$element Horde_Xml_Element

프로퍼티 상세

$_appended 보호되어 있는 프로퍼티

protected bool $_appended
리턴 boolean

$_children 보호되어 있는 프로퍼티

protected array $_children
리턴 array

$_element 보호되어 있는 프로퍼티

protected DOMElement $_element
리턴 DOMElement

$_namespaces 보호되어 있는 정적으로 프로퍼티

protected static array $_namespaces
리턴 array

$_parentElement 보호되어 있는 프로퍼티

protected Horde_Xml_Element $_parentElement
리턴 Horde_Xml_Element

$_serialized 보호되어 있는 프로퍼티

A string representation of the element, used when serializing/unserializing.
protected string $_serialized
리턴 string