Lifestream
Class

Lyrixx\Lifestream\Lifestream

class Lifestream

Class Lifestream is the engine of Lifestream library.

Methods

__construct(ServiceInterface $service = null, array $filters = array(), array $formatters = array(), StreamInterface $stream = null)

Constructor

Lifestream boot()

Fetch datas, filter and format them.

ServiceInterface getService()

Return the service

setService(ServiceInterface $service)

Set the service

addFilter(FilterInterface $filter)

Add a filter

setFilters(array $filters)

Set a collection of filter They must implement FilterInterface

addFormatter(FormatterInterface $formatter)

Add a formatter

setFormatters(array $formatters)

Set a collection of formatter They must implement FormatterInterface

StreamInterface getStream()

Return a StreamInterface with all Statuses

Details

at line 28
public __construct(ServiceInterface $service = null, array $filters = array(), array $formatters = array(), StreamInterface $stream = null)

Constructor

Parameters

ServiceInterface $service A service
array $filters An array of filter
array $formatters An array of formatter
StreamInterface $stream A stream

at line 42
public Lifestream boot()

Fetch datas, filter and format them.

Return Value

Lifestream $this

at line 79
public ServiceInterface getService()

Return the service

Return Value

ServiceInterface The service

at line 89
public setService(ServiceInterface $service)

Set the service

Parameters

ServiceInterface $service The service

at line 101
public addFilter(FilterInterface $filter)

Add a filter

Parameters

FilterInterface $filter A filter

at line 114
public setFilters(array $filters)

Set a collection of filter They must implement FilterInterface

Parameters

array $filters A collection of filter

at line 128
public addFormatter(FormatterInterface $formatter)

Add a formatter

Parameters

FormatterInterface $formatter A formatter

at line 141
public setFormatters(array $formatters)

Set a collection of formatter They must implement FormatterInterface

Parameters

array $formatters A collection of formatter

at line 159
public StreamInterface getStream()

Return a StreamInterface with all Statuses

Lifestream::boot() must be called before this method.

Return Value

StreamInterface The Stream

Exceptions

LogicException If lifestream is not booted