public function delete(Application $app, Request $request, $id)
{
$this->isTokenValid($app);
$TargetTaxRule = $app['eccube.repository.tax_rule']->find($id);
if (!$TargetTaxRule) {
$app->deleteMessage();
return $app->redirect($app->url('admin_setting_shop_tax'));
}
if (!$TargetTaxRule->isDefaultTaxRule()) {
$app['eccube.repository.tax_rule']->delete($TargetTaxRule);
$event = new EventArgs(array('TargetTaxRule' => $TargetTaxRule), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_TAX_RULE_DELETE_COMPLETE, $event);
$app->addSuccess('admin.shop.tax.delete.complete', 'admin');
}
return $app->redirect($app->url('admin_setting_shop_tax'));
}