class DOMNamedNodeMap implements IteratorAggregate, Countable (View source)

The DOMNamedNodeMap class

Properties

int read-only $length

The number of nodes in the map. The range of valid child node indices is 0 to length - 1 inclusive.

Methods

DOMNode|null
getNamedItem(string $qualifiedName)

Retrieves a node specified by name

void
setNamedItem(DOMNode $arg)

No description

removeNamedItem(mixed $name)

No description

DOMNode|null
item(int $index)

Retrieves a node specified by index

DOMNode|null
getNamedItemNS($namespaceURI = '', string|null $namespace, string $localName)

Retrieves a node specified by local name and namespace URI

setNamedItemNS(DOMNode $arg)

No description

removeNamedItemNS(mixed $namespace, mixed $localName)

No description

int
count()

Get number of nodes in the map

getIterator()

Retrieve an external iterator

Details

DOMNode|null getNamedItem(string $qualifiedName)

Retrieves a node specified by name

Parameters

string $qualifiedName

The nodeName of the node to retrieve.

Return Value

DOMNode|null

A node (of any type) with the specified nodeName, or null if no node is found.

void setNamedItem(DOMNode $arg)

No description

Parameters

DOMNode $arg

Return Value

void

removeNamedItem(mixed $name)

No description

Parameters

mixed $name [optional]

DOMNode|null item(int $index)

Retrieves a node specified by index

Parameters

int $index

Index into this map.

Return Value

DOMNode|null

The node at the indexth position in the map, or null if that is not a valid index (greater than or equal to the number of nodes in this map).

DOMNode|null getNamedItemNS($namespaceURI = '', string|null $namespace, string $localName)

Retrieves a node specified by local name and namespace URI

Parameters

$namespaceURI
string|null $namespace

The namespace URI of the node to retrieve.

string $localName

The local name of the node to retrieve.

Return Value

DOMNode|null

A node (of any type) with the specified local name and namespace URI, or null if no node is found.

setNamedItemNS(DOMNode $arg)

No description

Parameters

DOMNode $arg [optional]

removeNamedItemNS(mixed $namespace, mixed $localName)

No description

Parameters

mixed $namespace [optional]
mixed $localName [optional]

int count()

Since: 7.2

Get number of nodes in the map

Gets the number of nodes in the map.

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

Traversable getIterator()

Since: 8.0

Retrieve an external iterator

Returns an external iterator for the named node map.

Return Value

Traversable

An instance of an object implementing Iterator or Traversable