PHP 클래스 FOF30\Model\DataModel\Collection

상속: extends FOF30\Utils\Collection
파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

공개 메소드들

메소드 설명
__call ( string $name, array $arguments ) Magic method which allows you to run a DataModel method to all items in the collection.
add ( mixed $item ) : Collection Add an item to the collection.
contains ( mixed $key ) : boolean Determine if a key exists in the collection.
diff ( Collection | array $collection ) : Collection Diff the collection with the given items.
fetch ( string $key ) : Collection Fetch a nested element of the collection.
find ( mixed $key, mixed $default = null ) : DataModel Find a model in the collection by key.
intersect ( Collection | array $collection ) : Collection Intersect the collection with the given items.
max ( string $key ) : mixed Get the max value of a given key.
merge ( Collection | array $collection ) : Collection Merge the collection with the given items.
min ( string $key ) : mixed Get the min value of a given key.
modelKeys ( ) : array Get the array of primary keys
removeById ( mixed $key ) : void Remove an item in the collection by key
toBase ( ) : Collection Get a base Support collection instance from this collection.
unique ( ) : Collection Return only unique items from the collection.

보호된 메소드들

메소드 설명
getDictionary ( Collection $collection ) : array Get a dictionary keyed by primary keys.

메소드 상세

__call() 공개 메소드

For example, you can do $collection->save('foobar' => 1) to update the 'foobar' column to 1 across all items in the collection. IMPORTANT: The return value of the method call is not returned back to you!
public __call ( string $name, array $arguments )
$name string The method to call
$arguments array The arguments to the method

add() 공개 메소드

Add an item to the collection.
public add ( mixed $item ) : Collection
$item mixed
리턴 Collection

contains() 공개 메소드

Determine if a key exists in the collection.
public contains ( mixed $key ) : boolean
$key mixed
리턴 boolean

diff() 공개 메소드

Diff the collection with the given items.
public diff ( Collection | array $collection ) : Collection
$collection FOF30\Utils\Collection | array
리턴 FOF30\Utils\Collection

fetch() 공개 메소드

Fetch a nested element of the collection.
public fetch ( string $key ) : Collection
$key string
리턴 Collection

find() 공개 메소드

Find a model in the collection by key.
public find ( mixed $key, mixed $default = null ) : DataModel
$key mixed
$default mixed
리턴 FOF30\Model\DataModel

getDictionary() 보호된 메소드

Get a dictionary keyed by primary keys.
protected getDictionary ( Collection $collection ) : array
$collection FOF30\Utils\Collection
리턴 array

intersect() 공개 메소드

Intersect the collection with the given items.
public intersect ( Collection | array $collection ) : Collection
$collection FOF30\Utils\Collection | array
리턴 Collection

max() 공개 메소드

Get the max value of a given key.
public max ( string $key ) : mixed
$key string
리턴 mixed

merge() 공개 메소드

Merge the collection with the given items.
public merge ( Collection | array $collection ) : Collection
$collection FOF30\Utils\Collection | array
리턴 FOF30\Utils\Collection

min() 공개 메소드

Get the min value of a given key.
public min ( string $key ) : mixed
$key string
리턴 mixed

modelKeys() 공개 메소드

Get the array of primary keys
public modelKeys ( ) : array
리턴 array

removeById() 공개 메소드

Remove an item in the collection by key
public removeById ( mixed $key ) : void
$key mixed
리턴 void

toBase() 공개 메소드

Get a base Support collection instance from this collection.
public toBase ( ) : Collection
리턴 FOF30\Utils\Collection

unique() 공개 메소드

Return only unique items from the collection.
public unique ( ) : Collection
리턴 FOF30\Utils\Collection