PHP Class Yosymfony\Spress\Core\Support\Collection

Author: Victor Puertas ([email protected])
Inheritance: implements IteratorAggregate, implements Countable
Afficher le fichier Open project: spress/spress Class Usage Examples

Protected Properties

Свойство Type Description
$elements

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

add() public méthode

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() public méthode

Gets the elements in this collection.
public all ( ) : array
Résultat array All elements in this collection

clear() public méthode

Clears all elements in this collection.
public clear ( )

count() public méthode

Gets the number of elements in this collection.
public count ( ) : integer
Résultat integer The number of elements

get() public méthode

Gets a element from the collection.
public get ( string $key ) : mixed
$key string The element identifier
Résultat mixed The element

getIterator() public méthode

Returns an iterator over the elements.
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator An \ArrayIterator object for iterating over elements

has() public méthode

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

keys() public méthode

Gets the keys registered in this collection.
public keys ( ) : array
Résultat array

remove() public méthode

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

set() public méthode

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

Property Details

$elements protected_oe property

protected $elements