trait DeepTypeTrait (View source)

Shared code for working with deeply-nested elements for types.

Properties

protected string $namespaceAlias The preferred alias for a particular XML Namespace URI.

Methods

getScalarSingleValue(object $root, string $nodeName, string|null $namespaceAlias = null)

Retrieves nodes that are simple scalars, and there is only one allowed value.

getComplexSingleValue(object $root, string $nodeName, string $className, string|null $namespaceAlias = null)

Retrieves nodes that are complex types, and there is only one allowed value.

iterable
getComplexMultipleValues(object $root, string $nodeName, string|null $namespaceAlias = null)

Retrieves nodes that are complex types, and there may be are more than one value.

Details

protected Node getScalarSingleValue(object $root, string $nodeName, string|null $namespaceAlias = null)

Retrieves nodes that are simple scalars, and there is only one allowed value.

Parameters

object $root The root node for performing the lookup. Expected to be either a stdClass (for Feed), or an SimplePie\Type\Entry instance.
string $nodeName The name of the tree node to retrieve. Available tree nodes can be viewed by looking at the response from getRoot().
string|null $namespaceAlias The XML namespace alias to apply.

Return Value

Node

protected TypeInterface getComplexSingleValue(object $root, string $nodeName, string $className, string|null $namespaceAlias = null)

Retrieves nodes that are complex types, and there is only one allowed value.

Parameters

object $root The root node for performing the lookup. Expected to be either a stdClass (for Feed), or an SimplePie\Type\Entry instance.
string $nodeName The name of the tree node to retrieve. Available tree nodes can be viewed by looking at the response from getRoot().
string $className The class name to instantiate when there is not a defined value.
string|null $namespaceAlias The XML namespace alias to apply.

Return Value

TypeInterface

protected iterable getComplexMultipleValues(object $root, string $nodeName, string|null $namespaceAlias = null)

Retrieves nodes that are complex types, and there may be are more than one value.

Parameters

object $root The root node for performing the lookup. Expected to be either a stdClass (for Feed), or an SimplePie\Type\Entry instance.
string $nodeName The name of the tree node to retrieve. Available tree nodes can be viewed by looking at the response from getRoot().
string|null $namespaceAlias The XML namespace alias to apply.

Return Value

iterable