public function authenticationSetting(Application $app, Request $request)
{
$form = $app->form()->getForm();
$BaseInfo = $app['eccube.repository.base_info']->get();
// 認証キーの取得
$form->add('authentication_key', 'text', array('label' => '認証キー', 'constraints' => array(new Assert\Regex(array('pattern' => "/^[0-9a-zA-Z]+\$/"))), 'data' => $BaseInfo->getAuthenticationKey()));
if ('POST' === $request->getMethod()) {
$form->handleRequest($request);
if ($form->isValid()) {
$data = $form->getData();
// 認証キーの登録
$BaseInfo->setAuthenticationKey($data['authentication_key']);
$app['orm.em']->flush($BaseInfo);
$app->addSuccess('admin.plugin.authentication.setting.complete', 'admin');
}
}
return $app->render('Store/authentication_setting.twig', array('form' => $form->createView()));
}