PHP 인터페이스 Puli\Repository\Api\ResourceCollection

부터: 1.0
저자: Bernhard Schussek ([email protected])
상속: extends Traversabl\Traversable, extends ArrayAcces\ArrayAccess, extends Countabl\Countable
파일 보기 프로젝트 열기: puli/repository 0 사용 예제들

공개 메소드들

메소드 설명
add ( Puli\Repository\Api\Resource\PuliResource $resource ) Adds a resource to the collection.
clear ( ) Removes all resources from the collection.
get ( integer $key ) : Puli\Repository\Api\Resource\PuliResource Returns the resource for a collection key.
getNames ( ) : string[] Returns the names of all resources in the collection.
getPaths ( ) : string[] Returns the paths of all resources in the collection.
has ( integer $key ) : boolean Returns whether a collection key exists.
isEmpty ( ) : boolean Returns whether the collection is empty.
keys ( ) : int[] Returns the keys of the collection.
merge ( Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable $resources ) Merges the given resources into the collection.
remove ( integer $key ) Removes a collection key from the collection.
replace ( Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable $resources ) Replaces the collection contents with the given resources.
set ( integer $key, Puli\Repository\Api\Resource\PuliResource $resource ) Sets a resource at a collection key.
toArray ( ) : Puli\Repository\Api\Resource\PuliResource[] Returns the collection contents as array.

메소드 상세

add() 공개 메소드

Adds a resource to the collection.
public add ( Puli\Repository\Api\Resource\PuliResource $resource )
$resource Puli\Repository\Api\Resource\PuliResource The added resource.

clear() 공개 메소드

Removes all resources from the collection.
public clear ( )

get() 공개 메소드

Returns the resource for a collection key.
public get ( integer $key ) : Puli\Repository\Api\Resource\PuliResource
$key integer The collection key.
리턴 Puli\Repository\Api\Resource\PuliResource The resource at the key.

getNames() 공개 메소드

The names are returned in the order of their resources in the collection.
또한 보기: PuliResource::getName
public getNames ( ) : string[]
리턴 string[] The names of the resources in the collection.

getPaths() 공개 메소드

The paths are returned in the order of their resources in the collection.
또한 보기: PuliResource::getPath
public getPaths ( ) : string[]
리턴 string[] The paths of the resources in the collection.

has() 공개 메소드

Returns whether a collection key exists.
public has ( integer $key ) : boolean
$key integer The collection key.
리턴 boolean Whether the collection key exists.

isEmpty() 공개 메소드

Returns whether the collection is empty.
public isEmpty ( ) : boolean
리턴 boolean Returns `true` only if the collection contains no resources.

keys() 공개 메소드

Returns the keys of the collection.
public keys ( ) : int[]
리턴 int[] The collection keys.

merge() 공개 메소드

Merges the given resources into the collection.
public merge ( Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable $resources )
$resources Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable The resources to merge into the collection.

remove() 공개 메소드

Removes a collection key from the collection.
public remove ( integer $key )
$key integer The collection key.

replace() 공개 메소드

Replaces the collection contents with the given resources.
public replace ( Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable $resources )
$resources Puli\Repository\Api\Resource\PuliResource[] | Traversabl\Traversable The resources to write into the collection.

set() 공개 메소드

Sets a resource at a collection key.
public set ( integer $key, Puli\Repository\Api\Resource\PuliResource $resource )
$key integer The collection key.
$resource Puli\Repository\Api\Resource\PuliResource The resource to set.

toArray() 공개 메소드

Returns the collection contents as array.
public toArray ( ) : Puli\Repository\Api\Resource\PuliResource[]
리턴 Puli\Repository\Api\Resource\PuliResource[] The resources in the collection.