concrete/src/Calendar/Event/EventService.php
public function generateDefaultOccurrences(CalendarEventVersion $version)
    {
        $repetitions = $version->getRepetitionEntityCollection();
        $query = $this->entityManager->createQuery('delete from calendar:CalendarEventVersionOccurrence o where o.version = :version');
        $query->setParameter('version', $version);
        $query->execute();

        foreach($repetitions as $repetitionEntity) {

            $repetition = $repetitionEntity->getRepetitionObject();

            $start = $repetition->getStartDateTimestamp() - 1;

            $datetime = new \DateTime('+5 years', $repetition->getTimezone());
            $end = $datetime->getTimestamp();

            $this->occurrenceFactory->generateOccurrences($version, $repetitionEntity, $start, $end);
        }
    }
public function generateDefaultOccurrences(CalendarEventVersion $version)
    {
        $repetitions = $version->getRepetitionEntityCollection();
        $query = $this->entityManager->createQuery('delete from calendar:CalendarEventVersionOccurrence o where o.version = :version');
        $query->setParameter('version', $version);
        $query->execute();

        foreach($repetitions as $repetitionEntity) {

            $repetition = $repetitionEntity->getRepetitionObject();

            $start = $repetition->getStartDateTimestamp() - 1;

            $datetime = new \DateTime('+5 years', $repetition->getTimezone());
            $end = $datetime->getTimestamp();

            $this->occurrenceFactory->generateOccurrences($version, $repetitionEntity, $start, $end);
        }
    }
public function generateDefaultOccurrences ( CalendarEventVersion $ version ) { $ repetitions = $ version -> getRepetitionEntityCollection ( ) ; $ query = $ this -> entityManager -> createQuery ( 'delete from calendar:CalendarEventVersionOccurrence o where o.version = :version' ) ; $ query -> setParameter ( 'version' , $ version ) ; $ query -> execute ( ) ; foreach ( $ repetitions as $ repetitionEntity ) { $ repetition = $ repetitionEntity -> getRepetitionObject ( ) ; $ start = $ repetition -> getStartDateTimestamp ( ) - 1 ; $ datetime = new \ DateTime ( '+5 years' , $ repetition -> getTimezone ( ) ) ; $ end = $ datetime -> getTimestamp ( ) ; $ this -> occurrenceFactory -> generateOccurrences ( $ version , $ repetitionEntity , $ start , $ end ) ; } }
Handles generating occurrences with the default start and end times
Handles generating occurrences with the default start and end times