public function load()
{
if (null == $this->getId()) {
$message = Message::error(__('Missing information to load the search.'));
$response = Response::getInstance();
$response->setRequestStatus($message->isSuccess());
$response->addJSON('fieldWithError', 'searchId');
$response->addJSON('message', $message);
exit;
}
$savedSearchesTbl = Util::backquote($this->_config['cfgRelation']['db']) . "." . Util::backquote($this->_config['cfgRelation']['savedsearches']);
$sqlQuery = "SELECT id, search_name, search_data " . "FROM " . $savedSearchesTbl . " " . "WHERE id = '" . $GLOBALS['dbi']->escapeString($this->getId()) . "' ";
$resList = PMA_queryAsControlUser($sqlQuery);
if (false === ($oneResult = $GLOBALS['dbi']->fetchArray($resList))) {
$message = Message::error(__('Error while loading the search.'));
$response = Response::getInstance();
$response->setRequestStatus($message->isSuccess());
$response->addJSON('fieldWithError', 'searchId');
$response->addJSON('message', $message);
exit;
}
$this->setSearchName($oneResult['search_name'])->setCriterias($oneResult['search_data'], true);
return true;
}