CollectionInterface

CollectionInterface
implements Countable, IteratorAggregate, Traversable

Known implementers

Sunrise\Collection\Collection

Methods Summary
public
# __construct( iterable $items = array ( ) )
Constructor of the class
public
# add( mixed $value )
Adds the given value to the collection
public
# set( mixed $key , mixed $value )
Sets the given key/value pair to the collection
public
# get( mixed $key , mixed $default = NULL )
Gets a value for the given key from the collection If the given key is not found in the collection, returns the given default value.
public
# remove( mixed $key , mixed $default = NULL )
Removes a value for the given key from the collection If the given key is not found in the collection, returns the given default value.
public
# exists( mixed $key )
Checks if the given key exists in the collection If the given key is found in the collection, returns true. If the given key is not found in the collection, returns false.
public
# contains( mixed $value )
Checks if the given value contains in the collection If the given value is found in the collection, returns true. If the given value is not found in the collection, returns false.
public
# update( array $items )
Updates the collection using the given items If an item is found in the collection, it will not be overwritten. If an item is not found in the collection, it will be added.
public
# upgrade( array $items )
Upgrades the collection using the given items If an item is found in the collection, it will be overwritten. If an item is not found in the collection, it will be added.
public
# clear( )
Clears the collection
public
# all( )
Gets the items of the collection as is
public
# toArray( )
Converts the collection to an array