Exemplo n.º 1
0
 /**
  * Save specialEvent.
  */
 function execute()
 {
     $specialEventDao =& DAORegistry::getDAO('SpecialEventDAO');
     $schedConf =& Request::getSchedConf();
     if (isset($this->specialEventId)) {
         $specialEvent =& $specialEventDao->getSpecialEvent($this->specialEventId);
     }
     if (!isset($specialEvent)) {
         $specialEvent = new SpecialEvent();
     }
     $specialEvent->setSchedConfId($schedConf->getId());
     $specialEvent->setName($this->getData('name'), null);
     // Localized
     $specialEvent->setDescription($this->getData('description'), null);
     // Localized
     $specialEvent->setStartTime(date('Y-m-d H:i:s', $this->getData('startTime')));
     $specialEvent->setEndTime(date('Y-m-d H:i:s', $this->getData('endTime')));
     // Update or insert specialEvent
     if ($specialEvent->getId() != null) {
         $specialEventDao->updateSpecialEvent($specialEvent);
     } else {
         $specialEventDao->insertSpecialEvent($specialEvent);
     }
 }