Properties

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Store the factory instance for the current class.

Type

\Charcoal\Factory\FactoryInterface

$collectionLoader

$collectionLoader : \Charcoal\Loader\CollectionLoader

Store the collection loader for the current class.

Type

\Charcoal\Loader\CollectionLoader

$adminConfig

$adminConfig : object

Type

object — The admin config object model.

$currentPage

$currentPage : integer

Type

integer — The current Page.

$numPerPage

$numPerPage : integer

Type

integer — Events by page.

$numPage

$numPage : integer

Type

integer — How many pages.

$entryCycle

$entryCycle : boolean

Type

boolean — Does the pager can cycle indefinitely.

$page

$page : integer

Type

integer — The page number.

$category

$category : integer

Type

integer — Id for category.

$archive

$archive : array<mixed,\Charcoal\Cms\EventInterface>

Type

array<mixed,\Charcoal\Cms\EventInterface> — The archive events collection.

$objType

$objType : object

Type

object — The event object model.

$featIdent

$featIdent : string

Type

string — The config ident for featured events.

$featList

$featList : array<mixed,\Charcoal\Cms\EventInterface>

Type

array<mixed,\Charcoal\Cms\EventInterface> — The config ident for featured events.

$mapEvents

$mapEvents : array

Type

array — The events mapped per [year][month][date].

$date

$date : \Charcoal\Cms\Service\Manager\datetime

Type

\Charcoal\Cms\Service\Manager\datetime — Datetime filter

$year

$year : mixed

Type

mixed — Year filter.

$month

$month : mixed

Type

mixed — Month filter.

$day

$day : mixed

Type

mixed — Day filter.

Methods

__construct()

__construct(array  $data) 

EventManager constructor.

Parameters

array $data

The Data.

Throws

\Exception

When $data index is not set.

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Retrieve the object model factory.

Throws

\RuntimeException

If the model factory was not previously set.

Returns

\Charcoal\Factory\FactoryInterface

collectionLoader()

collectionLoader() : \Charcoal\Loader\CollectionLoader

Retrieve the model collection loader.

Throws

\RuntimeException

If the collection loader was not previously set.

Returns

\Charcoal\Loader\CollectionLoader

setAdminConfig()

setAdminConfig(mixed  $adminConfig) : self

Parameters

mixed $adminConfig

The admin configuration.

Returns

self

adminConfig()

adminConfig() : mixed

Returns

mixed

entries()

entries() : mixed

To be displayed events list.

Returns

mixed —

The event collection.

entry()

entry(integer|null  $id = null) : mixed

Parameters

integer|null $id

The event id.

Returns

mixed

all()

all() : array<mixed,\Charcoal\Cms\EventInterface>|\Charcoal\Model\Collection

All available events

Returns

array<mixed,\Charcoal\Cms\EventInterface>|\Charcoal\Model\Collection —

The events collection

loadCategoryItems()

loadCategoryItems() : array<mixed,\Charcoal\Object\CategoryInterface>|\Charcoal\Model\Collection

Returns

array<mixed,\Charcoal\Object\CategoryInterface>|\Charcoal\Model\Collection —

The category collection.

categoryItem()

categoryItem(integer  $id) : \Charcoal\Object\CategoryInterface|\Charcoal\Cms\EventCategory

Parameters

integer $id

The category id.

Returns

\Charcoal\Object\CategoryInterface|\Charcoal\Cms\EventCategory

featList()

featList(array  $options = array()) : mixed

Get featured events from config objects with custom filters as options.

Parameters

array $options

The options for the collection loader.

Throws

\Exception

When featured news ident is not valid.

Returns

mixed

archive()

archive() : array<mixed,\Charcoal\Cms\EventInterface>|\Charcoal\Model\Collection

Returns

array<mixed,\Charcoal\Cms\EventInterface>|\Charcoal\Model\Collection

latest()

latest() : \Charcoal\Cms\EventInterface|array

Get the latest event.

Returns

\Charcoal\Cms\EventInterface|array —

The latest event.

prev()

prev() : mixed

Returns

mixed —

The previous event

next()

next() : mixed

Returns

mixed —

The next event

currentPage()

currentPage() : float|integer

Returns

float|integer —

The current event index page ident.

getEventsByDate()

getEventsByDate(mixed  $date) : array

Parameters

mixed $date

The date from which to load.

Returns

array

currentEvent()

currentEvent() : mixed

Returns

mixed

numPerPage()

numPerPage() : integer

Returns

integer

entryCycle()

entryCycle() : boolean

Returns

boolean

numEvent()

numEvent() : integer

Amount of event (total)

Returns

integer —

How many event?

numPages()

numPages() : float

The total amount of pages.

Returns

float

hasPager()

hasPager() : boolean

Is there a pager.

Returns

boolean

page()

page() : integer

Returns

integer

category()

category() : integer

Returns

integer

objType()

objType() : mixed

Returns

mixed

featIdent()

featIdent() : mixed

Returns

mixed

date()

date() : mixed

Datetime object OR null.

Returns

mixed —

Datetime or null.

year()

year() : integer

Full year

Returns

integer —

Full year.

month()

month() : mixed

Month

Returns

mixed —

month.

day()

day() : mixed

Day

Returns

mixed —

day.

setCurrentEvent()

setCurrentEvent(mixed  $currentEvent) : self

Parameters

mixed $currentEvent

The current event context.

Returns

self

setNumPerPage()

setNumPerPage(integer  $numPerPage) : self

Parameters

integer $numPerPage

The number of event per page.

Returns

self

setEntryCycle()

setEntryCycle(boolean  $entryCycle) : self

Parameters

boolean $entryCycle

Next and Prev cycles indefinitely.

Returns

self

setPage()

setPage(integer  $page) : self

Parameters

integer $page

The page number to load.

Returns

self

setCategory()

setCategory(integer  $category) : self

Parameters

integer $category

The current entry category.

Returns

self

setObjType()

setObjType(mixed  $objType) : self

Parameters

mixed $objType

The object type.

Returns

self

setFeatIdent()

setFeatIdent(mixed  $featIdent) : self

Parameters

mixed $featIdent

The featured list ident.

Returns

self

setDate()

setDate(\DateTime  $date) : self

Set date filter.

Parameters

\DateTime $date

Date filter.

Returns

self

setYear()

setYear(mixed  $year) : \Charcoal\Cms\Service\Manager\EventManager

Full year.

Parameters

mixed $year

Full year.

Throws

\Exception

If argument is not scalar.

Returns

\Charcoal\Cms\Service\Manager\EventManager

setMonth()

setMonth(mixed  $month) : \Charcoal\Cms\Service\Manager\EventManager

Month.

Parameters

mixed $month

Specific month.

Throws

\Exception

If argument is not scalar.

Returns

\Charcoal\Cms\Service\Manager\EventManager

setDay()

setDay(mixed  $day) : \Charcoal\Cms\Service\Manager\EventManager

Day.

Parameters

mixed $day

Specific day.

Throws

\Exception

If argument is not scalar.

Returns

\Charcoal\Cms\Service\Manager\EventManager

setPrevNext()

setPrevNext() : $this

Set the Prev and Next event

Returns

$this

mapEvents()

mapEvents() : array

Mapping between events and dates

Returns

array —

The array containing events stored as [$year][$month][$day][event]

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : self

Set an object model factory.

Parameters

\Charcoal\Factory\FactoryInterface $factory

The model factory, to create objects.

Returns

self

setCollectionLoader()

setCollectionLoader(\Charcoal\Loader\CollectionLoader  $loader) : self

Set a model collection loader.

Parameters

\Charcoal\Loader\CollectionLoader $loader

The collection loader.

Returns

self