exists() public method

Does the check based on the uid.
public exists ( ) : boolean
return boolean True if event exists, false otherwise.
Ejemplo n.º 1
0
 /**
  * Saves an event in the backend.
  *
  * If it is a new event, it is added, otherwise the event is updated.
  *
  * @param Kronolith_Event $event  The event to save.
  *
  * @return string  The event id.
  * @throws Horde_Mime_Exception
  * @throws Kronolith_Exception
  */
 public function saveEvent(Kronolith_Event $event)
 {
     if ($event->stored || $event->exists()) {
         // If this event recurs and has bound exceptions, we must make sure
         // that the exceptionoriginaldate is updated in those exceptions as
         // well. See Bug: 13512
         if ($event->recurs()) {
             foreach ($event->boundExceptions() as $bound) {
                 $t = $event->start->strftime('%T');
                 $bound->exceptionoriginaldate = new Horde_Date($bound->start->strftime('%Y-%m-%d') . 'T' . $t);
                 $bound->save();
             }
         }
         return $this->_updateEvent($event);
     }
     return $this->_addEvent($event);
 }
Ejemplo n.º 2
0
 /**
  * Saves an event in the backend.
  *
  * If it is a new event, it is added, otherwise the event is updated.
  *
  * @param Kronolith_Event $event  The event to save.
  *
  * @return string  The event id.
  * @throws Horde_Mime_Exception
  * @throws Kronolith_Exception
  */
 public function saveEvent(Kronolith_Event $event)
 {
     if (empty($event->start) || $event->start->year <= 0 || empty($event->end) || $event->end->year <= 0) {
         throw new Kronolith_Exception(_("Invalid date"));
     }
     if ($event->stored || $event->exists()) {
         return $this->_updateEvent($event);
     }
     return $this->_addEvent($event);
 }