protected function render($app, $form, $headers, $twig)
{
if ($this->hasErrors()) {
if ($this->em) {
$this->em->getConnection()->rollback();
}
}
if (!empty($this->fileName)) {
try {
$fs = new Filesystem();
$fs->remove($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
} catch (\Exception $e) {
// エラーが発生しても無視する
}
}
return $app->render($twig, array('form' => $form->createView(), 'headers' => $headers, 'errors' => $this->errors));
}