protected function process() { $info = Helper::map(self::$MAP_INFO, $this->_xml); $info['descriptions'] = Helper::map(self::$MAP_DESCRIPTION, $this->_xml); $info['category'] = CategoryEnum::toFloat($info['category']); $info['images'] = []; foreach ($this->_xml->Pictures->Picture as $picture) { $info['images'][] = (string) $picture; } $this->_data = $info; }
protected function process() { $hotels = []; foreach ($this->_xml->Hotel as $node) { $hotel = Helper::map(self::$MAP_HOTEL, $node); //$hotel['category'] = CategoryEnum::toFloat($hotel['category']); $hotel['city_id'] = $this->getRequest()->getCity(); if (!array_key_exists($hotel['hotel_code'], $hotels)) { $hotels[$hotel['hotel_code']] = $hotel; $hotels[$hotel['hotel_code']]['rooms'] = []; } $room = Helper::map(self::$MAP_ROOM, $node); //$room['hotel_code'] = $hotel['hotel_code']; $room['date_cancel'] = Helper::fixCxlDate($room['date_cancel']); $hotels[$hotel['hotel_code']]['rooms'][] = $room; } $this->_data = $hotels; }
protected function process() { $transfers = []; $search_id = (string) $this->_xml->searchID; //ez a fejben van foreach ($this->_xml->TransferResult as $node) { $transfer = Helper::map(self::$MAP, $node); //fenti static alapján átnevezi /* //órát át kell váltani percé preg_match('/((?<hour>[\d\.\,]+)\shours?)?((?<minute>[\d\.\,]+)\smin(ute)?s?)?/',$transfer['minute'],$matches); $hour = floatval(str_replace(',','.',$matches['hour'])); $minute = floatval(str_replace(',','.',$matches['minute'])); $transfer['minute'] = $hour * 60 + $minute; */ $transfer['search_id'] = $search_id; $transfers[] = $transfer; } $this->_data = $transfers; }
protected function process() { $this->_data = Helper::map(self::$MAP_INFO, $this->_xml); $this->_data['alternative_hotel'] = !is_object($this->_xml->NoAlternativeHotel); $this->_data['leader_person'] = max(1, $this->_xml->Leader['LeaderPersonID']); }
protected function process() { $transfer = Helper::map(self::$MAP, $this->_xml); //fenti static alapján átnevezi $this->_data = $transfer; }