public function ProvidersController::saveProviderSettings in Persistent URL 8
1 string reference to 'ProvidersController::saveProviderSettings'
File
- src/
Controller/ ProvidersController.php, line 39
Class
Namespace
Drupal\purl\ControllerCode
public function saveProviderSettings(Request $request) {
if ($request
->getMethod() === "POST") {
$providers = $request->request
->get('providers', array());
foreach ($providers as $providerId => $data) {
$provider = $this->providerManager
->getProvider($providerId);
if ($data['method']) {
$this->providerManager
->saveProviderConfiguration($providerId, $data['method'], isset($data['settings']) ? $data['settings'] : array());
$this->modifierIndex
->indexModifiers($provider, $data['method']);
}
else {
$this->providerManager
->deleteProviderConfiguration($providerId);
$this->modifierIndex
->deleteEntriesByProvider($providerId);
}
}
}
return $this
->redirect('purl.admin');
}