Copied!

Class Collection

  • package PHPHtmlParser\Dom
Cloneable Instantiable Iterable
  • Implements
    ArrayAccess
    Countable
    IteratorAggregate
    Stringable
    Traversable
Methods
public __call ( string $method , array $arguments )
 

Attempts to call the method on the first node in
the collection.

  • return mixed
  • throws EmptyCollectionException
public __get ( $key )
 

Attempts to apply the magic get to the first node
in the collection.

  • return mixed
  • throws EmptyCollectionException
public __toString () : string
 

Applies the magic string method to the first node in
the collection.

  • return string
public count () : int
 

Returns the count of the collection.

  • return int
public each ( callable $callback )
 

Similar to jQuery "each" method. Calls the callback with each
Node in this collection.

public getIterator () : ArrayIterator
 

Returns an iterator for the collection.

  • return ArrayIterator
public offsetExists ( $offset ) : bool
 

Checks if an offset exists.

  • return bool
public offsetGet ( $offset )
 

Gets a node at the given offset, or null

  • return mixed
public offsetSet ( $offset , $value ) : void
 

Set an attribute by the given offset

public offsetUnset ( $offset ) : void
 

Unset a collection Node.

public toArray () : array
 

Returns this collection as an array.

  • return array
Properties
protected $collection
 

The collection of Nodes.

  • var array
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only