/** * {@inheritDoc} */ public function hasUpdated(ICalendar $calendar) { $privateUri = $calendar->getPrivateUri(); $userId = $calendar->getUserId(); $oldCalendar = $this->find($privateUri, $userId); return $calendar->getCtag() !== $oldCalendar->getCtag(); }
/** * Reset values that shall not be updated by the user directly * @param \OCA\Calendar\ICalendar &$new * @param \OCA\Calendar\ICalendar $old */ private function resetReadOnlyProperties(ICalendar &$new, ICalendar $old) { $new->setUserId($old->getUserId()); $new->setOwnerId($old->getOwnerId()); $new->setCruds($old->getCruds()); $new->setCtag($old->getCtag()); }
/** * {@inheritDoc} */ public function hasUpdated(ICalendar $calendar) { $oldCTag = $calendar->getCtag(); $currentCTag = $this->generateCTag(); return $oldCTag !== $currentCTag; }
/** * @param ICalendar $calendar * @return array */ private function getCalendarSqlParams(ICalendar $calendar) { return [$calendar->getUserId(), $calendar->getDisplayname(), $calendar->getPrivateUri(), $calendar->getEnabled(), $calendar->getCtag(), $calendar->getOrder(), $calendar->getColor(), $this->getTypes($calendar->getComponents(), 'string')]; }