class EventService (View source)

Constants

EVENT_VERSION_RECENT

EVENT_VERSION_APPROVED

INTERVAL_VERSION

Properties

protected $entityManager
protected $config
protected $occurrenceFactory
protected $eventCategory
protected $dispatcher

Methods

__construct(EntityManagerInterface $entityManagerInterface, Repository $config, EventOccurrenceFactory $occurrenceFactory, EventCategory $eventCategory, EventDispatcher $dispatcher)

No description

getByID($id, $retrieveVersion = self::EVENT_VERSION_APPROVED)

No description

getVersionByID($id)

No description

getVersionToModify(CalendarEvent $event, User $u)

Returns a new calendar event version object, duplicated from the most recent one – or if the event has no version objects simply returns a new one.

addEventVersion(CalendarEvent $event, Calendar $calendar, CalendarEventVersion $version, $repetitions = array())

No description

save(CalendarEvent $event)

No description

approve(CalendarEventVersion $version)

No description

unapprove(CalendarEvent $event)

No description

duplicate(CalendarEvent $event, User $u, Calendar $calendar = null)

No description

delete(CalendarEvent $event)

No description

deleteVersion(CalendarEventVersion $version)

No description

isRelatedTo(CalendarEvent $event1, CalendarEvent $event2)

No description

generateDefaultOccurrences(CalendarEventVersion $version)

Handles generating occurrences with the default start and end times

requireOccurrenceRegeneration($repetitions1, $repetitions2)

Returns true if the difference between the event versions impacts repetitions and occurrences.

Details

__construct(EntityManagerInterface $entityManagerInterface, Repository $config, EventOccurrenceFactory $occurrenceFactory, EventCategory $eventCategory, EventDispatcher $dispatcher)

Parameters

EntityManagerInterface $entityManagerInterface
Repository $config
EventOccurrenceFactory $occurrenceFactory
EventCategory $eventCategory
EventDispatcher $dispatcher

getByID($id, $retrieveVersion = self::EVENT_VERSION_APPROVED)

Parameters

$id
$retrieveVersion

getVersionByID($id)

Parameters

$id

getVersionToModify(CalendarEvent $event, User $u)

Returns a new calendar event version object, duplicated from the most recent one – or if the event has no version objects simply returns a new one.

Parameters

CalendarEvent $event
User $u

addEventVersion(CalendarEvent $event, Calendar $calendar, CalendarEventVersion $version, $repetitions = array())

Parameters

CalendarEvent $event
Calendar $calendar
CalendarEventVersion $version
$repetitions

save(CalendarEvent $event)

Parameters

CalendarEvent $event

approve(CalendarEventVersion $version)

Parameters

CalendarEventVersion $version

unapprove(CalendarEvent $event)

Parameters

CalendarEvent $event

duplicate(CalendarEvent $event, User $u, Calendar $calendar = null)

Parameters

CalendarEvent $event
User $u
Calendar $calendar

delete(CalendarEvent $event)

Parameters

CalendarEvent $event

deleteVersion(CalendarEventVersion $version)

Parameters

CalendarEventVersion $version

isRelatedTo(CalendarEvent $event1, CalendarEvent $event2)

Parameters

CalendarEvent $event1
CalendarEvent $event2

generateDefaultOccurrences(CalendarEventVersion $version)

Handles generating occurrences with the default start and end times

Parameters

CalendarEventVersion $version

requireOccurrenceRegeneration($repetitions1, $repetitions2)

Returns true if the difference between the event versions impacts repetitions and occurrences.

Parameters

$repetitions1
$repetitions2