PHP 클래스 Spot\Entity\Collection

상속: implements Iterator, implements Countable, implements ArrayAccess
파일 보기 프로젝트 열기: vlucas/spot 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_entityName
$_results
$_resultsIdentities

공개 메소드들

메소드 설명
__construct ( array $results = [], array $resultsIdentities = [], $entityName = null ) Constructor function
__toString ( ) Provides a string representation of the class Brackets contain the number of elements contained in the collection
add ( object $entity ) Add a single entity to the collection
count ( ) Get a count of all the records in the result set
current ( ) ----------------------------------------------
entityName ( )
filter ( $func ) : mixed Runs a function on every object in the query, returning an array containing every object for which the function returns true.
first ( ) : The Returns first result in set
key ( )
map ( $func ) : mixed Runs a function on every object in the query, returning the resulting array
merge ( Collection $collection, $onlyUnique = true ) Merge another collection into this collections set of entities This will only add entitys that don't already exist in the current collection
next ( )
offsetExists ( $key ) ----------------------------------------------
offsetGet ( $key )
offsetSet ( $key, $value )
offsetUnset ( $key )
rewind ( )
run ( $callback ) Run a function on the set of entities
toArray ( mixed $keyColumn = null, mixed $valueColumn = null ) : array Return an array representation of the Collection.
valid ( )

메소드 상세

__construct() 공개 메소드

Constructor function
public __construct ( array $results = [], array $resultsIdentities = [], $entityName = null )
$results array Array of pre-loaded Spot_Entity objects or Iterator that will fetch them lazily
$resultsIdentities array Array of key values for given result set primary key

__toString() 공개 메소드

Provides a string representation of the class Brackets contain the number of elements contained in the collection
public __toString ( )

add() 공개 메소드

Add a single entity to the collection
public add ( object $entity )
$entity object to add

count() 공개 메소드

Get a count of all the records in the result set
public count ( )

current() 공개 메소드

----------------------------------------------
public current ( )

entityName() 공개 메소드

public entityName ( )

filter() 공개 메소드

Runs a function on every object in the query, returning an array containing every object for which the function returns true.
public filter ( $func ) : mixed
리턴 mixed An array of Entity objects

first() 공개 메소드

Returns first result in set
public first ( ) : The
리턴 The first result in the set

key() 공개 메소드

public key ( )

map() 공개 메소드

Runs a function on every object in the query, returning the resulting array
public map ( $func ) : mixed
리턴 mixed An array containing the result of running the passed function on each member of the collect

merge() 공개 메소드

Merge another collection into this collections set of entities This will only add entitys that don't already exist in the current collection
public merge ( Collection $collection, $onlyUnique = true )
$collection Collection

next() 공개 메소드

public next ( )

offsetExists() 공개 메소드

----------------------------------------------
public offsetExists ( $key )

offsetGet() 공개 메소드

public offsetGet ( $key )

offsetSet() 공개 메소드

public offsetSet ( $key, $value )

offsetUnset() 공개 메소드

public offsetUnset ( $key )

rewind() 공개 메소드

public rewind ( )

run() 공개 메소드

Run a function on the set of entities
public run ( $callback )

toArray() 공개 메소드

Return an array representation of the Collection.
public toArray ( mixed $keyColumn = null, mixed $valueColumn = null ) : array
$keyColumn mixed
$valueColumn mixed
리턴 array If $keyColumn and $valueColumn are not set, or are both null then this will return the array of entity objects

valid() 공개 메소드

public valid ( )

프로퍼티 상세

$_entityName 보호되어 있는 프로퍼티

protected $_entityName

$_results 보호되어 있는 프로퍼티

protected $_results

$_resultsIdentities 보호되어 있는 프로퍼티

protected $_resultsIdentities