Documentation

NodeList implements SeekableIterator, ArrayAccess, Countable

Interfaces, Classes and Traits

SeekableIterator
ArrayAccess
Countable

Table of Contents

$array  : array<string|int, mixed>
$offset  : int
__construct()  : mixed
NodeList constructor.
clear()  : NodeList
Clears the array (makes it empty) and returns the array reference.
count()  : int
current()  : DOMNode|PrototypeHTMLElement|null
each()  : NodeList
Calls iterator for each item in the collection.
findAll()  : array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>
Returns all the elements for which the iterator returned a truthy value.
first()  : DOMNode|PrototypeHTMLElement|null
Returns the array's first item
fromIterable()  : NodeList
inspect()  : string
Returns the debug-oriented string representation of the object.
item()  : DOMNode|PrototypeHTMLElement|null
Returns the item on $offset or null if none is found
key()  : int
last()  : DOMNode|PrototypeHTMLElement|null
Returns the array's last item
map()  : array<string|int, mixed>
Returns the result of applying iterator to each element.
match()  : bool
Checks if an element in the NodeList matches the given DOMNode
merge()  : NodeList
Merges one NodeList into another
next()  : void
offsetExists()  : bool
offsetGet()  : DOMNode|PrototypeHTMLElement|null
offsetSet()  : DOMNode|PrototypeHTMLElement|null
offsetUnset()  : void
pluck()  : array<string|int, mixed>
Pre-baked implementation for a common use-case of Enumerable#collect and Enumerable#each: fetching the same property for all of the elements. Returns an array of the property values.
reject()  : array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>
Returns all the elements for which the iterator returns a falsy value.
reverse()  : NodeList
Reverses the array's contents.
rewind()  : void
seek()  : void
toArray()  : array<string|int, mixed>
Returns an Array containing the elements of the enumeration.
valid()  : bool

Properties

$array

protected array<string|int, mixed> $array = []

Methods

__construct()

NodeList constructor.

public __construct([iteratable<string|int, mixed> $nodes = null ]) : mixed
Parameters
$nodes : iteratable<string|int, mixed> = null
Return values
mixed

count()

public count() : int
Tags
inheritDoc
Return values
int

findAll()

Returns all the elements for which the iterator returned a truthy value.

public findAll(callable|Closure $iterator) : array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>

For the opposite operation, see Enumerable#reject.

Parameters
$iterator : callable|Closure
Tags
link
http://api.prototypejs.org/language/Enumerable/prototype/findAll/
throws
InvalidArgumentException
Return values
array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>

fromIterable()

public fromIterable(iteratable<string|int, mixed> $nodes) : NodeList
Parameters
$nodes : iteratable<string|int, mixed>
Return values
NodeList

key()

public key() : int
Tags
inheritDoc
Return values
int

match()

Checks if an element in the NodeList matches the given DOMNode

public match(DOMNode $node) : bool
Parameters
$node : DOMNode
Return values
bool

next()

public next() : void
Tags
inheritDoc
Return values
void

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Tags
inheritDoc
Return values
bool

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Tags
inheritDoc
Return values
void

pluck()

Pre-baked implementation for a common use-case of Enumerable#collect and Enumerable#each: fetching the same property for all of the elements. Returns an array of the property values.

public pluck(string $property) : array<string|int, mixed>
Parameters
$property : string
Tags
link
http://api.prototypejs.org/language/Enumerable/prototype/pluck/
Return values
array<string|int, mixed>

reject()

Returns all the elements for which the iterator returns a falsy value.

public reject(callable|Closure $iterator) : array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>

For the opposite operation, see Enumerable#findAll.

Parameters
$iterator : callable|Closure
Tags
link
http://api.prototypejs.org/language/Enumerable/prototype/reject/
throws
InvalidArgumentException
Return values
array<string|int, \chillerlan\PrototypeDOM\Node\PrototypeNode|\chillerlan\PrototypeDOM\Node\PrototypeHTMLElement|\DOMNode>

rewind()

public rewind() : void
Tags
inheritDoc
Return values
void

seek()

public seek(mixed $offset) : void
Parameters
$offset : mixed
Tags
inheritDoc
Return values
void

valid()

public valid() : bool
Tags
inheritDoc
Return values
bool

Search results