class Node extends AbstractType implements NodeInterface, TypeInterface (View source)

A type model for a deep-level Node element.

Properties

protected DOMNode|null $node The raw DOMNode element.
protected string|null $value The content of the node, serialized appropriately.
protected string|null $lang The language of the content.
protected string|null $base The xml:base value of the content.
protected string $serialization The serialization of the content.

Methods

__call(string $nodeName, array $args)

Proxy method which forwards requests to an underlying handler.

string
getUnresolvableMessage(string $nodeName)

Gets the standard, pre-formatted message for unresolvable method calls.

__construct(DOMNode|null $node = null, array $fallback = [])

Get the text node in multiple formats.

string
__toString()

Casting this Node element to a string with return the value of the Node.

static Node
factory(string $value)

Creates a new Node object from a string of text (such as from an XML attribute).

DOMNode|null
getNode()

Gets the raw DOMNode element.

string|null
getValue()

Gets the content of the node, serialized appropriately.

string
getSerialization()

Gets the serialization of the content.

getLang()

Gets the language of the content.

getBase()

Gets the xml:base of the content.

string
getAlias(string $nodeName)

Finds the common internal alias for a given method name.

getHandler(string $nodeName, array $args = [])

Get the correct handler for a whitelisted method name.

Details

__call(string $nodeName, array $args)

Proxy method which forwards requests to an underlying handler.

Parameters

string $nodeName The name of the method being called.
array $args Any arguments passed into that method.

protected string getUnresolvableMessage(string $nodeName)

Gets the standard, pre-formatted message for unresolvable method calls.

Parameters

string $nodeName The short version of the call (without the get).

Return Value

string

__construct(DOMNode|null $node = null, array $fallback = [])

Get the text node in multiple formats.

Parameters

DOMNode|null $node A DOMNode element to read properties from.
array $fallback An array of attributes for default XML attributes. The default value is an empty array.

string __toString()

Casting this Node element to a string with return the value of the Node.

Return Value

string

static Node factory(string $value)

Creates a new Node object from a string of text (such as from an XML attribute).

Parameters

string $value The string of text to convert to a Node object.

Return Value

Node

DOMNode|null getNode()

Gets the raw DOMNode element.

Return Value

DOMNode|null

string|null getValue()

Gets the content of the node, serialized appropriately.

Return Value

string|null

string getSerialization()

Gets the serialization of the content.

Will always be one of the enums from SimplePie\Enum\Serialization.

Return Value

string

Node getLang()

Gets the language of the content.

Return Value

Node

Node getBase()

Gets the xml:base of the content.

Return Value

Node

string getAlias(string $nodeName)

Finds the common internal alias for a given method name.

Parameters

string $nodeName The name of the method being called.

Return Value

string

Node getHandler(string $nodeName, array $args = [])

Get the correct handler for a whitelisted method name.

Parameters

string $nodeName The name of the method being called.
array $args The parameters which are passed to the method.

Return Value

Node

Exceptions

SimplePieException