if (!\
array_key_exists('taxId',
$detail)) { throw new NotFoundException('details.taxId'
);
} // If no order number was specified for the details we use the one from the order if there is one
if ((!\
array_key_exists('number',
$detail) ||
$detail['number'
] !==
$params['number'
]) && !
empty($params['number'
])) { $detail['number'
] =
$params['number'
];
} $detailModel =
new Detail();
$detailModel->
fromArray($detail);
$status =
$this->
getContainer()->
get(ModelManager::
class)->
find(DetailStatus::
class,
$detail['statusId'
]);
if (!
$status) { throw new NotFoundException(sprintf('DetailStatus by id %s not found',
$detail['statusId'
]));
} $detailModel->
setStatus($status);
unset($detail['statusId'
]);
$tax =
$this->
getContainer()->
get(ModelManager::
class)->
find(Tax::
class,
$detail['taxId'
]);
if (!
$tax) {