private function _sync() { $event = $this->_calendar->getEventById($this->_reservation->getIdGoogleEvent()); if ($event->getStatus() == self::EVENT_STATUS_CANCELLED) { $this->_deleteLocal(); } else { $localUpdateTime = $this->_reservation->getLastSaveTime(); $remoteUpdateTime = DateTime::create($event->getUpdated())->getTimestamp(); if ($localUpdateTime < $remoteUpdateTime) { $this->_updateLocal($event); } else { $this->_updateRemote($event); } } }