<?php
namespace App\Amadeus\StructureParser\Structures\Train; class ServiceDetails extends \App\Amadeus\StructureParser\Parser\ServiceDetails { public function getDetails() { if($this->CACHE[__METHOD__]) return $this->CACHE[__METHOD__]; $parsedStructure = $this->transaction->getParsedStructure(); $indexType = $this->transaction->getIndexType(); $index = $this->transaction->getIndex(); $U = $parsedStructure['U'][$index->segment]; if($indexType=='U' && $U['_type']=='17'){ $details = $this->getDetails_U_17(); if($details){ $this->CACHE[__METHOD__] = $details; return $details; } } return null; } protected function getDetails_U_17() { $item = new \App\Amadeus\StructureParser\Types\ServiceDetails(); $parsedStructure = $this->transaction->getParsedStructure(); $item = $this->extractCommonServiceDetails($parsedStructure, $item); return $item; } public function getRelations() { if($this->CACHE[__METHOD__]) return $this->CACHE[__METHOD__]; $parsedStructure = $this->transaction->getParsedStructure(); $index = $this->transaction->getIndex(); $relations = new \App\Amadeus\StructureParser\Types\Relations(); $relations = $this->extractReferencesData($parsedStructure, $index, $relations); return $relations; } } 