Code
extends AbstractStringContainer
in package
Table of Contents
- $data : array<string, mixed>
- $content : string
- $depth : int
- $firstChild : Node|null
- $lastChild : Node|null
- $next : Node|null
- $parent : Node|null
- $previous : Node|null
- __clone() : mixed
- Clone the current node and its children
- __construct() : mixed
- appendChild() : void
- children() : array<string|int, Node>
- children() : array<string|int, Node>
- detach() : void
- detachChildren() : void
- Detaches all child nodes of given node
- firstChild() : Node|null
- getContent() : string
- getData() : mixed
- getDepth() : int
- insertAfter() : void
- Inserts the $sibling node after $this
- insertBefore() : void
- Inserts the $sibling node before $this
- isContainer() : bool
- lastChild() : Node|null
- next() : Node|null
- parent() : Node|null
- prependChild() : void
- Adds $child as the very first child of $this
- previous() : Node|null
- replaceChildren() : $this
- Replace all children of given node with collection of another
- replaceWith() : void
- setContent() : $this
- walker() : NodeWalker
- setParent() : void
Properties
$data
public
array<string, mixed>
$data
= []
$content
protected
string
$content
= ''
$depth
protected
int
$depth
= 0
$firstChild
protected
Node|null
$firstChild
$lastChild
protected
Node|null
$lastChild
$next
protected
Node|null
$next
$parent
protected
Node|null
$parent
$previous
protected
Node|null
$previous
Methods
__clone()
Clone the current node and its children
public
__clone() : mixed
WARNING: This is a recursive function and should not be called on deeply-nested node trees!
Return values
mixed —__construct()
public
__construct([string $contents = '' ][, array<string, mixed> $data = [] ]) : mixed
Parameters
- $contents : string = ''
- $data : array<string, mixed> = []
Return values
mixed —appendChild()
public
appendChild(Node $child) : void
Parameters
- $child : Node
Return values
void —children()
public
children() : array<string|int, Node>
Return values
array<string|int, Node> —children()
public
children() : array<string|int, Node>
AbstractInline[]
Return values
array<string|int, Node> —detach()
public
detach() : void
Return values
void —detachChildren()
Detaches all child nodes of given node
public
detachChildren() : void
Return values
void —firstChild()
public
firstChild() : Node|null
Return values
Node|null —getContent()
public
getContent() : string
Return values
string —getData()
public
getData(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —getDepth()
public
getDepth() : int
Return values
int —insertAfter()
Inserts the $sibling node after $this
public
insertAfter(Node $sibling) : void
Parameters
- $sibling : Node
Return values
void —insertBefore()
Inserts the $sibling node before $this
public
insertBefore(Node $sibling) : void
Parameters
- $sibling : Node
Return values
void —isContainer()
public
abstract isContainer() : bool
Return values
bool —lastChild()
public
lastChild() : Node|null
Return values
Node|null —next()
public
next() : Node|null
Return values
Node|null —parent()
public
parent() : Node|null
Return values
Node|null —prependChild()
Adds $child as the very first child of $this
public
prependChild(Node $child) : void
Parameters
- $child : Node
Return values
void —previous()
public
previous() : Node|null
Return values
Node|null —replaceChildren()
Replace all children of given node with collection of another
public
replaceChildren(iteratable<string|int, Node> $children) : $this
Parameters
- $children : iteratable<string|int, Node>
Return values
$this —replaceWith()
public
replaceWith(Node $replacement) : void
Parameters
- $replacement : Node
Return values
void —setContent()
public
setContent(string $contents) : $this
Parameters
- $contents : string
Return values
$this —walker()
public
walker() : NodeWalker
Return values
NodeWalker —setParent()
protected
setParent([Node|null $node = null ]) : void
Parameters
- $node : Node|null = null