private function buildSearchParams($start, $destinations, $rooms) { $tourBuilder = new TourBuilderForm(); $tourBuilder->setStartCityName($start); $tourBuilder->rooms = array(); foreach ($rooms as $room) { $newRoom = new HotelRoomForm(); $newRoom->adultCount = $room['adt']; $newRoom->childCount = $room['chd']; $newRoom->childAge = $room['chdAge']; $newRoom->cots = $room['cots']; $tourBuilder->rooms[] = $newRoom; } $tourBuilder->trips = array(); foreach ($destinations as $destination) { $trip = new TripForm(); $trip->setCityName($destination['city']); $trip->startDate = $destination['dateFrom']; $trip->endDate = $destination['dateTo']; $tourBuilder->trips[] = $trip; } return $tourBuilder; }