PHP 클래스 Yosymfony\Spress\Core\Support\Collection

저자: Victor Puertas ([email protected])
상속: implements IteratorAggregate, implements Countable
파일 보기 프로젝트 열기: spress/spress 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$elements

공개 메소드들

메소드 설명
__construct ( array $elements = [] ) Constructor.
add ( mixed $key, mixed $element ) Adds a new element in this collection.
all ( ) : array Gets the elements in this collection.
clear ( ) Clears all elements in this collection.
count ( ) : integer Gets the number of elements in this collection.
get ( string $key ) : mixed Gets a element from the collection.
getIterator ( ) : ArrayIterator Returns an iterator over the elements.
has ( string $key ) : boolean Checks if a elements exists in the collection.
keys ( ) : array Gets the keys registered in this collection.
remove ( string $key ) Removes a element from the collection.
set ( mixed $key, mixed $element ) Sets an element.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $elements = [] )
$elements array Elements

add() 공개 메소드

Adds a new element in this collection.
public add ( mixed $key, mixed $element )
$key mixed The key associated to the element
$element mixed The element

all() 공개 메소드

Gets the elements in this collection.
public all ( ) : array
리턴 array All elements in this collection

clear() 공개 메소드

Clears all elements in this collection.
public clear ( )

count() 공개 메소드

Gets the number of elements in this collection.
public count ( ) : integer
리턴 integer The number of elements

get() 공개 메소드

Gets a element from the collection.
public get ( string $key ) : mixed
$key string The element identifier
리턴 mixed The element

getIterator() 공개 메소드

Returns an iterator over the elements.
public getIterator ( ) : ArrayIterator
리턴 ArrayIterator An \ArrayIterator object for iterating over elements

has() 공개 메소드

Checks if a elements exists in the collection.
public has ( string $key ) : boolean
$key string The elements identifier or index
리턴 boolean

keys() 공개 메소드

Gets the keys registered in this collection.
public keys ( ) : array
리턴 array

remove() 공개 메소드

Removes a element from the collection.
public remove ( string $key )
$key string The element identifier or index

set() 공개 메소드

Sets an element.
public set ( mixed $key, mixed $element )
$key mixed The key associated to the element
$element mixed The element

프로퍼티 상세

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

protected $elements