<?php
namespace App\Sabre\StructureParser\Structures\DocumentIssue;

class Itinerary extends \App\Sabre\StructureParser\Structures\Ticketing\Itinerary
{
	protected function _getData()
	{
		list($parsedStructure, $transactionType, $transactionIndexes, $internalAssociations) = $this->getTransactionDetails();

		$item = new \App\Sabre\StructureParser\Types\Itinerary();
		foreach ($parsedStructure['M3'] as $km3=>$M3) {
			if ($M3['M3Air']) {
				$segment = new \App\Sabre\StructureParser\Types\ItinerarySegment();
				$segment = $this->fillItinerarySegment($segment, $km3, $M3, $parsedStructure, $transactionType, $transactionIndexes, $internalAssociations);
				$item->appendSegment($segment);
			}
		}

		return $item;
	}
}
