$tax = $this->getContainer()->get(ModelManager::class)->find(Tax::class, $detail['taxId']); if(!$tax){ thrownewNotFoundException(sprintf('Tax by id %s not found', $detail['taxId'])); } $detailModel->setTax($tax); unset($detail['taxId']);
// Set shipped flag
if(\array_key_exists('shipped', $detail)){ $detailModel->setShipped($detail['shipped']); }