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

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

		$M3 = $parsedStructure['M3'][$transactionIndexes['km3']];

		$item = new \App\Sabre\StructureParser\Types\Document();


		$item->docDate =	$parsedStructure['M0']['M0']['IU0PDT'];
		$item->docNumber = 	($M3['M3Oths']['IU3VR4_']['CF']?:$M3['M3Oths']['IU3CFN']);

		$this->populate($item, $parsedStructure, $transactionType, $transactionIndexes, $internalAssociations);

		return $item;
	}
}
