Nodelist for DOM XPath query

 Methods

Constructor

__construct(string $cssQuery, string | array $xpathQuery, \DOMDocument $document, \DOMNodeList $nodeList) : void

Parameters

$cssQuery

string

$xpathQuery

stringarray

$document

\DOMDocument

$nodeList

\DOMNodeList

Countable: get count

count() : int

Returns

int

Iterator: return current element

current() : \DOMNode

Returns

Retrieve CSS Query

getCssQuery() : string

Returns

string

Retrieve DOMDocument

getDocument() : \DOMDocument

Returns

Retrieve XPath query

getXpathQuery() : string

Returns

string

Iterator: return key of current element

key() : int

Returns

int

ArrayAccess: offset exists

offsetExists(int $key) : bool

Parameters

$key

int

Returns

bool

ArrayAccess: get offset

offsetGet(int $key) : mixed

Parameters

$key

int

Returns

mixed

ArrayAccess: set offset

offsetSet($key, $value) : void

Parameters

$key

$value

Exceptions

\Zend\Dom\Exception\BadMethodCallException when attemptingn to write to a read-only item

ArrayAccess: unset offset

offsetUnset($key) : void

Parameters

$key

Exceptions

\Zend\Dom\Exception\BadMethodCallException when attemptingn to unset a read-only item

Iterator: rewind to first element

rewind() : \DOMNode

Returns

Iterator: is current position valid?

valid() : bool

Returns

bool

 Properties

 

CSS Selector query

$cssQuery : string

 

$document

$document : \DOMDocument

 

$nodeList

$nodeList : \DOMNodeList

 

Current iterator position

$position : int

 

XPath query

$xpathQuery : string