If you want to update the PHP files with a new version of the OTA specifications, follow these steps:
-
Download preferred version of OTA specs from the official website:
- Fill in the details, select
1.0OpenTravel Version and the publication needed. - You will receive an email with the zip file.
- Unpack the archive and open
OpenTravel_[version]_XMLdirectory. All the XML definitions are there.
- Fill in the details, select
-
Clone this repository to your local machine.
-
Empty the following directories:
resources/ota/commonNOTE: keep this directoryresources/otaNOTE: keep this directoryresources/metadataresources/validationsrc
-
Copy the following list of files to the
resources/ota/commondirectory from the publication you just downloaded:- OTA_AirCommonTypes.xsd
- OTA_AirPreferences.xsd
- OTA_CommonPrefs.xsd
- OTA_CommonTypes.xsd
- OTA_HotelCommonTypes.xsd
- OTA_HotelContentDescription.xsd
- OTA_HotelEvent.xsd
- OTA_HotelPreferences.xsd
- OTA_HotelProduct.xsd
- OTA_HotelRatePlan.xsd
- OTA_HotelReservation.xsd
- OTA_HotelRFP.xsd
- OTA_Lists.xsd
- OTA_Profile.xsd
- OTA_RailCommonTypes.xsd
- OTA_RailPreferences.xsd
- OTA_SimpleTypes.xsd
- OTA_VehicleCommonTypes.xsd
These are the common files that contain types which OTA request and response messages use. Unfortunately, there is no other way to copy them rather than just manually pick them from the publication.
-
Copy all the files that START with
OTA_Hoteland END withRQORRSinto project'sresources/otadirectory from the publication you just downloaded. -
Run the following command:
php vendor/bin/xsd2php convert config/xsd2php.yml ./resources/ota/OTA_*.xsdIt will convert all the schemas into PHP classes and put them into
src/DTOdirectory. Additionally, it will generate metadata and validation files and put them inresources/metadataandresources/validationdirectories respectively. You can tweak the configuration of this command inconfig/xsd2php.ymlfile.