/**
  * @param Route $route
  * @return Route
  */
 public function saveRoute(Route $route)
 {
     $id = $route->getRouteId();
     $data = $route->getArrayCopy();
     if ($id > 0) {
         $this->update($data, array('routeId' => $id));
     } else {
         unset($data['routeId']);
         $this->insert($data);
     }
     if (!$route->getRouteId()) {
         $route->setRouteId($this->getLastInsertValue());
     }
     return $route;
 }