getParsedBodyParamAsString('db'); $label = $request->getParsedBodyParamAsString('label'); $bookmarkQuery = $request->getParsedBodyParamAsString('bookmark_query'); $shared = $request->getParsedBodyParamAsString('shared'); $bookmark = $this->bookmarkRepository->createBookmark( $bookmarkQuery, $label, $this->config->selectedServer['user'], $db, $shared === 'true', ); if ($bookmark === false || ! $bookmark->save()) { $this->response->addJSON('message', __('Failed')); return $this->response->response(); } $bookmarkFields = [ 'bkm_database' => $db, 'bkm_user' => $this->config->selectedServer['user'], 'bkm_sql_query' => $bookmarkQuery, 'bkm_label' => $label, ]; $this->response->addJSON('message', __('Succeeded')); $this->response->addJSON('data', $bookmarkFields); $this->response->addJSON('isShared', $shared === 'true'); return $this->response->response(); } }