PHP 클래스 FooCollection

상속: extends Collections\Collection
파일 보기 프로젝트 열기: danielgsims/php-collections

공개 메소드들

메소드 설명
__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

메소드 상세

__construct() 공개 메소드

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() 공개 메소드

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

find() 공개 메소드

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.
리턴 {{foo}}

findAll() 공개 메소드

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.
리턴 {{FooCollection}}

findLast() 공개 메소드

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.
리턴 {{foo}}

getRange() 공개 메소드

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
리턴 {{FooCollection}}