class AssetCollectionFilterIterator extends RecursiveFilterIterator

Asset collection filter iterator.

The filter iterator is responsible for de-duplication of leaf assets based on both strict equality and source URL.

Properties

private $visited
private $sources

Methods

__construct(AssetCollectionIterator $iterator, array $visited = [], array $sources = [])

Constructor.

bool
accept()

Determines whether the current asset is a duplicate.

getChildren()

Passes visited objects and source URLs to the child iterator.

Details

at line 35
__construct(AssetCollectionIterator $iterator, array $visited = [], array $sources = [])

Constructor.

Parameters

AssetCollectionIterator $iterator

The inner iterator

array $visited

An array of visited asset objects

array $sources

An array of visited source strings

at line 51
bool accept()

Determines whether the current asset is a duplicate.

De-duplication is performed based on either strict equality or by matching sources.

Return Value

bool

Returns true if we have not seen this asset yet

at line 83
getChildren()

Passes visited objects and source URLs to the child iterator.