/** * * @param Symfony\Component\HttpFoundation\Request $request * * @return Symfony\Component\HttpFoundation\Response */ public function updateSchemaAction(Request $request) { $this->validateAccessForRole('ROLE_ACCESS_THEMES'); $updater = new SchemaUpdater($this->getService('em')); $updater->updateSchema(); return new JsonResponse(['status' => true]); }
protected function updateSchema(Request $request, $_token) { $token = new CsrfToken(static::SCHEMA_TOKEN_INTENTION, $_token); if ($this->getService('csrfTokenManager')->isTokenValid($token)) { $updater = new SchemaUpdater($this->getService('em')); $updater->updateSchema(); $msg = $this->getTranslator()->trans('database.schema.updated'); $this->publishConfirmMessage($request, $msg); } else { throw new \RuntimeException($this->getTranslator()->trans('database.schema.cannot_updated'), 1); } }
/** * * @param Symfony\Component\HttpFoundation\Request $request * * @return Symfony\Component\HttpFoundation\Response */ public function updateSchemaAction(Request $request) { $updater = new SchemaUpdater($this->getService('em')); $updater->updateSchema(); return new JsonResponse(['status' => true]); }