Fork me on Github

Class CalendR\Event\Collection\ Basic

Basic event collection.

Juste stores event as an array, and iterate over the array for retrieving.


Implements: CollectionInterface

Methods

__construct( array $events = array())

add( EventInterface $event)

Adds an event to the collection

remove( EventInterface $event)

Removes an event from the collection

array<EventInterface> all()

Return all events;

bool has( mixed $index)

Returns if there is events corresponding to $index period

array<EventInterface> find( mixed $index)

Find events in the collection

int count()

Details

public __construct( array $events = array())

Parameters
array $events

public add( EventInterface $event)

Adds an event to the collection

Parameters
EventInterface $event

public remove( EventInterface $event)

Removes an event from the collection

Parameters
EventInterface $event

public array<EventInterface> all()

Return all events;

Return Value
array<EventInterface>

public bool has( mixed $index)

Returns if there is events corresponding to $index period

Parameters
mixed $index
Return Value
bool

public array<EventInterface> find( mixed $index)

Find events in the collection

Parameters
mixed $index
Return Value
array<EventInterface>

public int count()

Return Value
int