PHP Класс PHPHtmlParser\Dom\InnerNode

Наследование: extends ArrayNode
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$children array An array of all the children.

Открытые методы

Метод Описание
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.

Описание методов

addChild() публичный Метод

Adds a child node to this node and returns the id of the child for this parent.
public addChild ( AbstractNode $child ) : boolean
$child AbstractNode
Результат boolean

countChildren() публичный Метод

Counts children
public countChildren ( ) : integer
Результат integer

firstChild() публичный Метод

Shortcut to return the first child.
public firstChild ( ) : AbstractNode
Результат AbstractNode

getChild() публичный Метод

Returns the child by id.
public getChild ( integer $id ) : AbstractNode
$id integer
Результат AbstractNode

getChildren() публичный Метод

Returns a new array of child nodes
public getChildren ( ) : array
Результат array

hasChildren() публичный Метод

Checks if this node has children.
public hasChildren ( ) : boolean
Результат boolean

isChild() публичный Метод

Checks if the given node id is a child of the current node.
public isChild ( integer $id ) : boolean
$id integer
Результат boolean

isDescendant() публичный Метод

Checks if the given node id is a descendant of the current node.
public isDescendant ( integer $id ) : boolean
$id integer
Результат boolean

lastChild() публичный Метод

Attempts to get the last child.
public lastChild ( ) : AbstractNode
Результат AbstractNode

nextChild() публичный Метод

Attempts to get the next child.
public nextChild ( integer $id ) : AbstractNode
$id integer
Результат AbstractNode

previousChild() публичный Метод

Attempts to get the previous child.
public previousChild ( integer $id ) : AbstractNode
$id integer
Результат AbstractNode

propagateEncoding() публичный Метод

Sets the encoding class to this node and propagates it to all its children.
public propagateEncoding ( stringEncode\Encode $encode ) : void
$encode stringEncode\Encode
Результат void

removeChild() публичный Метод

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

replaceChild() публичный Метод

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() публичный Метод

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

Описание свойств

$children защищенное свойство

An array of all the children.
protected array $children
Результат array