PHP Класс Yosymfony\Spress\Core\Support\Collection

Автор: Victor Puertas ([email protected])
Наследование: implements IteratorAggregate, implements Countable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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