PHP Class FooCollection

Inheritance: extends Collections\Collection
Mostrar archivo Open project: danielgsims/php-collections

Public Methods

Method Description
__construct ( string $objectName = "{{foo}}" ) Instantiates the collection by specifying what type of Object will be used.
at ( integer $index ) : {{foo}} Fetches the item at the specified index
find ( callable $condition ) : {{foo}} Finds and returns the first item in the collection that satisfies the callback.
findAll ( callable $condition ) : {{FooCollection}} Returns a collection of all items that satisfy the callback function. If nothing is found, returns an empty Collection
findLast ( callable $condition ) : {{foo}} Finds and returns the last item in the collection that satisfies the callback.
getRange ( integer $start, integer $end ) : {{FooCollection}} Get a range of items in the collection

Method Details

__construct() public method

Instantiates the collection by specifying what type of Object will be used.
public __construct ( string $objectName = "{{foo}}" )
$objectName string Name of the class or interface used in the Collection

at() public method

Fetches the item at the specified index
public at ( integer $index ) : {{foo}}
$index integer The index of an item to fetch
return {{foo}}

find() public method

Finds and returns the first item in the collection that satisfies the callback.
public find ( callable $condition ) : {{foo}}
$condition callable The condition critera to test each item, requires one argument that represents the Collection item during iteration.
return {{foo}}

findAll() public method

Returns a collection of all items that satisfy the callback function. If nothing is found, returns an empty Collection
public findAll ( callable $condition ) : {{FooCollection}}
$condition callable The condition critera to test each item, requires one argument that represents the Collection item during iteration.
return {{FooCollection}}

findLast() public method

Finds and returns the last item in the collection that satisfies the callback.
public findLast ( callable $condition ) : {{foo}}
$condition callable The condition criteria to test each item, requires one argument that represents the Collection item during an iteration.
return {{foo}}

getRange() public method

Get a range of items in the collection
public getRange ( integer $start, integer $end ) : {{FooCollection}}
$start integer The starting index of the range
$end integer The ending index of the range
return {{FooCollection}}