FileCollection
extends AbstractFileCollection
in package
Collection of objects stored into a filesystem.
Tags
Table of Contents
Properties
- $collection : mixed
- $createObjectFunction : callable
- $filterFunction : callable|null
- $flags : int
- $iterator : RecursiveDirectoryIterator|RecursiveUniformResourceIterator
- $nestingLimit : int
- $path : string
Methods
- __construct() : mixed
- addFilter() : $this
- chunk() : array<string|int, mixed>
- Split collection into chunks.
- getFlags() : int
- getNestingLimit() : int
- getPath() : string
- jsonSerialize() : array<string|int, mixed>
- matching() : ArrayCollection
- reverse() : CollectionInterface
- Reverse the order of the items.
- select() : CollectionInterface
- Select items from collection.
- setFilter() : $this
- setNestingLimit() : $this
- setObjectBuilder() : $this
- shuffle() : CollectionInterface
- Shuffle items.
- unselect() : CollectionInterface
- Un-select items from collection.
- createObject() : object
- doInitialize() : mixed
- {@inheritDoc}
- doInitializeByIterator() : array<string|int, mixed>
- doInitializeChildren() : array<string|int, mixed>
- setIterator() : void
Properties
$collection
protected
mixed
$collection
Tags
$createObjectFunction
protected
callable
$createObjectFunction
$filterFunction
protected
callable|null
$filterFunction
$flags
protected
int
$flags
$iterator
protected
RecursiveDirectoryIterator|RecursiveUniformResourceIterator
$iterator
$nestingLimit
protected
int
$nestingLimit
$path
protected
string
$path
Methods
__construct()
public
__construct(string $path[, int $flags = null ]) : mixed
Parameters
- $path : string
- $flags : int = null
addFilter()
public
addFilter(callable $filterFunction) : $this
Parameters
- $filterFunction : callable
Return values
$thischunk()
Split collection into chunks.
public
chunk(mixed $size) : array<string|int, mixed>
Parameters
- $size : mixed
-
Size of each chunk.
Return values
array<string|int, mixed>getFlags()
public
getFlags() : int
Return values
intgetNestingLimit()
public
getNestingLimit() : int
Return values
intgetPath()
public
getPath() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>matching()
public
matching(Criteria $criteria) : ArrayCollection
Parameters
- $criteria : Criteria
Tags
Return values
ArrayCollectionreverse()
Reverse the order of the items.
public
reverse() : CollectionInterface
Tags
Return values
CollectionInterfaceselect()
Select items from collection.
public
select(array<string|int, mixed> $keys) : CollectionInterface
Parameters
- $keys : array<string|int, mixed>
Tags
Return values
CollectionInterfacesetFilter()
public
setFilter([callable|null $filterFunction = null ]) : $this
Parameters
- $filterFunction : callable|null = null
Return values
$thissetNestingLimit()
public
setNestingLimit([int $limit = 99 ]) : $this
Parameters
- $limit : int = 99
Return values
$thissetObjectBuilder()
public
setObjectBuilder([callable|null $objectFunction = null ]) : $this
Parameters
- $objectFunction : callable|null = null
Return values
$thisshuffle()
Shuffle items.
public
shuffle() : CollectionInterface
Tags
Return values
CollectionInterfaceunselect()
Un-select items from collection.
public
unselect(array<string|int, mixed> $keys) : CollectionInterface
Parameters
- $keys : array<string|int, mixed>
Tags
Return values
CollectionInterfacecreateObject()
protected
createObject(RecursiveDirectoryIterator $file) : object
Parameters
- $file : RecursiveDirectoryIterator
Return values
objectdoInitialize()
{@inheritDoc}
protected
doInitialize() : mixed
doInitializeByIterator()
protected
doInitializeByIterator(SeekableIterator $iterator, int $nestingLimit) : array<string|int, mixed>
Parameters
- $iterator : SeekableIterator
- $nestingLimit : int
Tags
Return values
array<string|int, mixed>doInitializeChildren()
protected
doInitializeChildren(array<string|int, mixed> $children, int $nestingLimit) : array<string|int, mixed>
Parameters
- $children : array<string|int, mixed>
- $nestingLimit : int
Return values
array<string|int, mixed>setIterator()
protected
setIterator() : void