Add importers in console and admin for flights/aircraft/subfleets and airport #194

This commit is contained in:
Nabeel Shahzad
2018-03-20 19:17:11 -05:00
parent 782121829a
commit b9beb6c804
41 changed files with 1270 additions and 225 deletions

View File

@@ -19,4 +19,31 @@ class FlightType extends Enum
FlightType::CARGO => 'Cargo',
FlightType::CHARTER => 'Charter',
];
/**
* Return value from P, C or H
* @param $code
* @return int
*/
public static function getFromCode($code): int
{
if(is_numeric($code)) {
return (int) $code;
}
$code = strtolower($code);
if($code === 'p') {
return self::PASSENGER;
}
if ($code === 'c') {
return self::CARGO;
}
if($code === 'h') {
return self::CHARTER;
}
return self::PASSENGER;
}
}