예제 #1
0
 /**
  * @param IObject $object
  * @param integer $calendarId
  * @return array
  */
 private function getObjectSqlParams(IObject $object, $calendarId)
 {
     return [$this->getType($object->getType(), 'string'), $this->getUTCforMDB($object->getStartDate()), $this->getUTCforMDB($object->getEndDate()), $object->getRepeating(), $object->getSummary(), $object->getCalendarData(), $this->getUTCforMDB($object->getLastModified()), $object->getUri(), $calendarId];
 }
예제 #2
0
 /**
  * @param IObject $object
  * @return IObject
  */
 public function update(IObject $object)
 {
     $calendarId = $this->calendar->getId();
     //TODO - (maybe) check uri exists already
     $sql = 'UPDATE `' . $this->getTableName() . '` SET ';
     $sql .= '`type` = ?, `etag` = ?, `startdate` = ?, `enddate` = ?, ';
     $sql .= '`repeating` = ?, `summary` = ?, `calendardata` = ?, ';
     $sql .= '`lastmodified` = ? WHERE `uri` = ? and `calendarid` = ?';
     $stmt = $this->execute($sql, [$object->getType(), $object->getEtag(true), $this->getUTC($object->getStartDate()), $this->getUTC($object->getEndDate()), $object->getRepeating(), $object->getSummary(), $object->getCalendarData(), $this->getUTC($object->getLastModified()), $object->getUri(), $calendarId]);
     $stmt->closeCursor();
     return $object;
 }