<?php
namespace App\Sabre\StructureParser\Structures\EMD; class Extradata extends \App\Sabre\StructureParser\Structures\Base\Base { protected $reasonCodes = [ 'A' => 'Air transportation', 'B' => 'Surface transportation/Non-air services', 'C' => 'Baggage', 'D' => 'Financial Impact', 'E' => 'Airport Services', 'F' => 'Merchandise', 'G' => 'In-flight services', ]; protected function _getData() { list($parsedStructure, , $transactionIndexes) = $this->getTransactionDetails(); $item = new \App\Sabre\StructureParser\Types\Extradata(); $MG = $parsedStructure['MG'][$transactionIndexes['kmg']]; $item->reasonCode = $MG['MG']['IUGRFI']; $item->reasonCode_text = $this->reasonCodes[$MG['MG']['IUGRFI']]; $item->reasonSubCode = $MG['IUGCIN'][0]['IUGCIN']['IUGCSR']; $item->reasonSubCode_text = $MG['IUGCIN'][0]['IUGCIN']['IUGCNR']; return $item; } } 