<?php
namespace App\Sabre\LineParser\Types\Line; class M1 extends \App\Sabre\LineParser\Types\SabreBaseLine { protected $children = [ ['key'=>'IU1MID', 'type'=>'Constant', 'len'=>2, 'val'=>'M1', 'label'=>'IU1MID'], ['key'=>'IU1PNO', 'type'=>'StringTrim', 'len'=>2, 'label'=>'IU1PNO'], ['key'=>'IU1PNM', 'type'=>'StringTrim', 'len'=>64, 'label'=>'IU1PNM'], ['key'=>'IU1PRK', 'type'=>'StringTrim', 'len'=>30, 'label'=>'IU1PRK'], ['key'=>'IU1IND', 'type'=>'StringTrim', 'len'=>1, 'label'=>'IU1IND'], ['key'=>'IU1AVN', 'type'=>'StringTrim', 'len'=>20, 'label'=>'IU1AVN'], ['key'=>'IU1MLV', 'type'=>'StringTrim', 'len'=>5, 'label'=>'IU1MLV'], ['key'=>'IU1NM3', 'type'=>'Integer', 'len'=>2, 'label'=>'IU1NM3'], ['key'=>'IU1TKT', 'type'=>'StringRaw', 'len'=>1, 'label'=>'IU1TKT'], ['key'=>'IU1SSM', 'type'=>'Constant', 'len'=>1, 'val'=>' ', 'label'=>'IU1SSM'], ['key'=>'IU1NM5', 'type'=>'Integer', 'len'=>2, 'label'=>'IU1NM5'], ['key'=>'IU1NM7', 'type'=>'Integer', 'len'=>2, 'label'=>'IU1NM7'], ['key'=>'IU1NM8', 'type'=>'Integer', 'len'=>2, 'label'=>'IU1NM8'], ['key'=>'IU1NM9', 'type'=>'Integer', 'len'=>2, 'label'=>'IU1NM9'], ['key'=>'IU1NMA', 'type'=>'StringTrim', 'len'=>2, 'label'=>'IU1NMA'], ['key'=>'NL', 'type'=>'NewLine',], ]; protected function postExtract(\App\Utils\BaseParser\TextParser\ExtractedBlock $ret) { $pn = new \App\Sabre\LineParser\PassengerNameParser(); $pn->setText($ret->extractedData['IU1PNM']); $xtr = $pn->extract(); $ret->extractedData['IU1PNM_'] = [ 'firstname' => $xtr->firstName, 'lastname' => $xtr->lastName, 'title' => $xtr->title, 'type' => $xtr->type, ]; return $ret; } } 