public function AlinksController::delete in Alinks 8
Remove the given entity type, bundle and display from alinks configuration.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse Return a redirect to the alinks settings page.
1 string reference to 'AlinksController::delete'
File
- src/
Controller/ AlinksController.php, line 48
Class
- AlinksController
- Returns responses for alinks configuration routes.
Namespace
Drupal\alinks\ControllerCode
public function delete($entity_type, $entity_bundle, $entity_display) {
$config = $this->configFactory
->getEditable('alinks.settings');
$displays = array_values(array_filter($config
->get('displays'), function ($display) use ($entity_type, $entity_bundle, $entity_display) {
return !($display['entity_type'] == $entity_type && $display['entity_bundle'] == $entity_bundle && $display['entity_display'] == $entity_display);
}));
$config
->set('displays', $displays)
->save();
return new RedirectResponse(Url::fromRoute('alink_keyword.settings')
->setAbsolute()
->toString());
}