public function valuesToForm()
 {
     $values = array('id' => $this->id, 'name' => $this->name, 'description' => $this->description, 'okToPublish' => $this->okToPublish, 'date' => strftime("%Y-%m-%d", $this->start), 'walkid' => $this->walkid, 'difficultyGrade' => $this->difficultyGrade, 'miles' => $this->miles, 'location' => $this->location, 'startGridRef' => $this->startGridRef, 'startPlaceName' => $this->startPlaceName, 'endGridRef' => $this->endGridRef, 'endPlaceName' => $this->endPlaceName, 'childFriendly' => $this->childFriendly, 'dogFriendly' => $this->dogFriendly, 'speedy' => $this->speedy, 'isLinear' => $this->isLinear, 'challenge' => $this->challenge, 'leaderid' => $this->leaderId, 'leadername' => $this->leaderName, 'backmarkerid' => $this->backmarkerId, 'backmarkername' => $this->backmarkerName, 'meetPointId' => $this->meetPointId, 'meetTime' => strftime("%H:%M", $this->start), 'meetPlaceTime' => $this->__get("meetPoint")->extra, 'headCount' => $this->headCount, 'distance' => $this->distance, 'alterations_details' => $this->alterations->details, 'alterations_date' => $this->alterations->placeTime, 'alterations_organiser' => $this->alterations->organiser, 'alterations_placeTime' => $this->alterations->date, 'alterations_cancelled' => $this->alterations->cancelled, 'track' => $this->track instanceof Track ? $this->track->jsonEncode() : false);
     if (isset($this->leader) && $this->leader->hasDisplayName) {
         $values['leadername'] = $this->leader->displayName;
     }
     if (isset($this->backmarker) && $this->backmarker->hasDisplayName) {
         $values['backmarkername'] = $this->backmarker->displayName;
     }
     // Try to load routes
     if (isset($this->id)) {
         $routes = Route::loadForWalkable($this, false, Route::Type_Planned, 1);
         if (!empty($routes)) {
             $values['routeid'] = $routes[0]->id;
         }
         $tracks = Route::loadForWalkable($this, false, Route::Type_Logged, 1);
         if (!empty($tracks)) {
             $values['trackid'] = $tracks[0]->id;
         }
     }
     return $values;
 }
 public function valuesToForm()
 {
     return array('id' => $this->id, 'name' => $this->name, 'distanceGrade' => $this->distanceGrade, 'difficultyGrade' => $this->difficultyGrade, 'miles' => $this->miles, 'location' => $this->location, 'isLinear' => (int) $this->isLinear, 'startGridRef' => $this->startGridRef, 'startPlaceName' => $this->startPlaceName, 'endGridRef' => $this->endGridRef, 'endPlaceName' => $this->endPlaceName, 'description' => $this->description, 'fileLinks' => $this->fileLinks, 'information' => $this->information, 'routeImage' => $this->routeImage, 'suggestedBy' => isset($this->suggestedBy) ? $this->suggestedBy->id : null, 'status' => $this->status, 'specialTBC' => $this->specialTBC, 'dogFriendly' => $this->dogFriendly, 'transportByCar' => $this->transportByCar, 'transportPublic' => $this->transportPublic, 'childFriendly' => $this->childFriendly, 'route' => $this->route instanceof Route ? $this->route->jsonEncode() : false, 'routeVisibility' => $this->routeVisibility);
 }