Class NodeList

Summary

Fully Qualified Name: Laminas\Dom\NodeList
Implements: Iterator, Countable, ArrayAccess

Description

Nodelist for DOM XPath query

Methods

Name Description Defined By
__construct() Constructor NodeList
count() Countable: get count NodeList
current() Iterator: return current element NodeList
getContextNode() Retrieve context node NodeList
getCssQuery() Retrieve CSS Query NodeList
getDocument() Retrieve DOMDocument NodeList
getXpathQuery() Retrieve XPath query NodeList
key() Iterator: return key of current element NodeList
next() Iterator: move to next element NodeList
offsetExists() ArrayAccess: offset exists NodeList
offsetGet() ArrayAccess: get offset NodeList
offsetSet() ArrayAccess: set offset NodeList
offsetUnset() ArrayAccess: unset offset NodeList
rewind() Iterator: rewind to first element NodeList
valid() Iterator: is current position valid? NodeList

Method Details

__construct()

Constructor

Parameter Name Type Description
$cssQuery string
$xpathQuery string|array
$document \DOMDocument
$nodeList \DOMNodeList
$contextNode \DOMNode|null

Returns:

count()

Countable: get count

Returns: int

current()

Iterator: return current element

Returns: \DOMNode

getContextNode()

Retrieve context node

Returns: \DOMNode

getCssQuery()

Retrieve CSS Query

Returns: string

getDocument()

Retrieve DOMDocument

Returns: \DOMDocument

getXpathQuery()

Retrieve XPath query

Returns: string

key()

Iterator: return key of current element

Returns: int

next()

Iterator: move to next element

Returns: \DOMNode

offsetExists()

ArrayAccess: offset exists

Parameter Name Type Description
$key int

Returns: bool

offsetGet()

ArrayAccess: get offset

Parameter Name Type Description
$key int

Returns: mixed

offsetSet()

ArrayAccess: set offset

Parameter Name Type Description
$key mixed
$value mixed

Returns:

offsetUnset()

ArrayAccess: unset offset

Parameter Name Type Description
$key mixed

Returns:

rewind()

Iterator: rewind to first element

Returns: \DOMNode

valid()

Iterator: is current position valid?

Returns: bool

Top