Esempio n. 1
0
 /**
  * Save changes for route
  */
 protected function saveChangesForRoute()
 {
     if (null === $this->Route || $this->OldRoute->isEmpty()) {
         return;
     }
     $this->Route->synchronize();
     if ($this->Route->isEmpty()) {
         $Deleter = new Model\Route\Deleter($this->PDO, $this->Route);
         $Deleter->setAccountID($this->AccountID);
         $Deleter->delete();
         $this->Route = null;
         $this->Activity->set(Entity::ROUTEID, 0);
         $this->Activity->set(Entity::ELEVATION, 0);
     } else {
         $Updater = new Model\Route\Updater($this->PDO, $this->Route, $this->OldRoute);
         $Updater->setAccountID($this->AccountID);
         $Updater->update();
     }
 }