private static function transformTicketsToArray(TicketsColletion $ticketsColletion) { $tickets = []; foreach ($ticketsColletion as $ticket) { $tickets[] = ["DescuOperativo" => $ticket->getDiscount(), "IdTiquete" => $ticket->getId(), "Origen" => $ticket->getFrom(), "Destino" => $ticket->getTo(), "IdTarifa" => $ticket->getIdPrice(), "Descuento" => null, "Puesto" => $ticket->getSeat(), "Valor" => $ticket->getPrice(), "ClieR8A" => Customer::transformToArray($ticket->getCustomer()), "NombreMenor" => $ticket->getNameChild()]; } return $tickets; }
public function buyTicket(Order $order, Customer $customer) { $params = ["vtoDatosVenta" => \Ochoa\Transform\Order::transformToArray($order), "crpDatosComprador" => \Ochoa\Transform\Customer::transformToArray($customer)]; $this->setHeaderSoap("RealizarVentaTiquetes"); $orderResult = $this->call("RealizarVentaTiquetes", $params); $validate = Validate::validBuyTicket($orderResult); $response = $validate != true ? $validate : $orderResult->RealizarVentaTiquetesResult; return $response; }