Exemple #1
0
 /**
  * build the recurrance for all events paying no attention to exceptions 
  * 
  * @return Tx_CzSimpleCal_Recurrance_Timeline_Event
  */
 protected function buildEventTimeline()
 {
     $type = $this->event->getRecurranceType();
     if (empty($type)) {
         throw new RuntimeException('The recurrance_type should not be empty.');
     }
     $className = 'Tx_CzSimpleCal_Recurrance_Type_' . \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($type);
     if (!class_exists($className)) {
         throw new BadMethodCallException(sprintf('The class %s does not exist for creating recurring events.', $className));
     }
     $class = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className);
     if (!$class instanceof Tx_CzSimpleCal_Recurrance_Type_Base) {
         throw new BadMethodCallException(sprintf('The class %s does not implement the Tx_CzSimpleCal_Recurrance_Type_Base.', get_class($class)));
     }
     $eventTimeline = new Tx_CzSimpleCal_Recurrance_Timeline_Event();
     $eventTimeline->setEvent($this->event);
     return $class->build($this->event, $eventTimeline);
 }