PHP Class PHPHtmlParser\Dom\InnerNode

Inheritance: extends ArrayNode
Datei anzeigen Open project: paquettg/php-html-parser Class Usage Examples

Protected Properties

Property Type Description
$children array An array of all the children.

Public Methods

Method Description
addChild ( AbstractNode $child ) : boolean Adds a child node to this node and returns the id of the child for this parent.
countChildren ( ) : integer Counts children
firstChild ( ) : AbstractNode Shortcut to return the first child.
getChild ( integer $id ) : AbstractNode Returns the child by id.
getChildren ( ) : array Returns a new array of child nodes
hasChildren ( ) : boolean Checks if this node has children.
isChild ( integer $id ) : boolean Checks if the given node id is a child of the current node.
isDescendant ( integer $id ) : boolean Checks if the given node id is a descendant of the current node.
lastChild ( ) : AbstractNode Attempts to get the last child.
nextChild ( integer $id ) : AbstractNode Attempts to get the next child.
previousChild ( integer $id ) : AbstractNode Attempts to get the previous child.
propagateEncoding ( stringEncode\Encode $encode ) : void Sets the encoding class to this node and propagates it to all its children.
removeChild ( integer $id ) Removes the child by id.
replaceChild ( integer $childId, AbstractNode $newChild ) Removes the child with id $childId and replace it with the new child $newChild.
setParent ( InnerNode $parent ) Sets the parent node.

Method Details

addChild() public method

Adds a child node to this node and returns the id of the child for this parent.
public addChild ( AbstractNode $child ) : boolean
$child AbstractNode
return boolean

countChildren() public method

Counts children
public countChildren ( ) : integer
return integer

firstChild() public method

Shortcut to return the first child.
public firstChild ( ) : AbstractNode
return AbstractNode

getChild() public method

Returns the child by id.
public getChild ( integer $id ) : AbstractNode
$id integer
return AbstractNode

getChildren() public method

Returns a new array of child nodes
public getChildren ( ) : array
return array

hasChildren() public method

Checks if this node has children.
public hasChildren ( ) : boolean
return boolean

isChild() public method

Checks if the given node id is a child of the current node.
public isChild ( integer $id ) : boolean
$id integer
return boolean

isDescendant() public method

Checks if the given node id is a descendant of the current node.
public isDescendant ( integer $id ) : boolean
$id integer
return boolean

lastChild() public method

Attempts to get the last child.
public lastChild ( ) : AbstractNode
return AbstractNode

nextChild() public method

Attempts to get the next child.
public nextChild ( integer $id ) : AbstractNode
$id integer
return AbstractNode

previousChild() public method

Attempts to get the previous child.
public previousChild ( integer $id ) : AbstractNode
$id integer
return AbstractNode

propagateEncoding() public method

Sets the encoding class to this node and propagates it to all its children.
public propagateEncoding ( stringEncode\Encode $encode ) : void
$encode stringEncode\Encode
return void

removeChild() public method

Removes the child by id.
public removeChild ( integer $id )
$id integer

replaceChild() public method

Removes the child with id $childId and replace it with the new child $newChild.
public replaceChild ( integer $childId, AbstractNode $newChild )
$childId integer
$newChild AbstractNode

setParent() public method

Sets the parent node.
public setParent ( InnerNode $parent )
$parent InnerNode

Property Details

$children protected_oe property

An array of all the children.
protected array $children
return array