// Convert params to model
$dispatchModel->fromArray($params);
// Convert the payment array to the payment model
foreach($paymentsas$paymentMethod){ if(empty($paymentMethod['id'])){ continue; } $paymentModel = $this->getModelManager()->find(Payment::class, $paymentMethod['id']); if($paymentModel instanceof Payment){ $dispatchModel->getPayments()->add($paymentModel); } }
// Convert the countries to their country models
foreach($countriesas$country){ if(empty($country['id'])){ continue; } $countryModel = $this->getModelManager()->find(Country::class, $country['id']); if($countryModel instanceof Country){ $dispatchModel->getCountries()->add($countryModel); }
if(\count($manifest->getAdmin()?->getModules() ?? []) > 0){ // if there is no app secret but the manifest specifies modules, throw an exception in dev mode
$usedFeatures[] = 'Admin Modules'; }