public function getSeatMap(RequestSeatMap $requestSeatMap) { $service_type = 'consultarAutobus'; $formattedDateOfRun = $requestSeatMap->getDateOfRun()->format('c'); $service_params = array('in0' => $requestSeatMap->getRunId(), 'in1' => $formattedDateOfRun, 'in2' => $requestSeatMap->getOriginId(), 'in3' => $requestSeatMap->getDestinationId(), 'in4' => $requestSeatMap->getPosId(), 'in5' => $requestSeatMap->getSaleTypeId(), 'in6' => $this->usuario, 'in7' => $this->password); $soap_param = array('ventaService' => $service_params); $soap_response = $this->callSoapServiceByType($service_type, $soap_param); $response = ResponseSeatMapFactory::create($soap_response); return $response; }
public static function create($params) { $requestSeatMap = new RequestSeatMap(); $requestSeatMap->setOriginId($params['origin_id']); $requestSeatMap->setDestinationId($params['destination_id']); if ($params['date_of_run'] instanceof \DateTime) { $requestSeatMap->setDateOfRun($params['date_of_run']); } else { throw new TypeException('Fecha de Corrida must be a Date Time'); } $requestSeatMap->setPosId($params['pos_id']); $requestSeatMap->setRunId($params['run_id']); //Dynamic number, this is a mock number $requestSeatMap->setSaleTypeId($params['sale_type_id']); return $requestSeatMap; }