示例#1
0
 /**
  *
  * @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]);
 }
示例#2
0
 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);
     }
 }
示例#3
0
 /**
  *
  * @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]);
 }