本文整理匯總了PHP中SearchHelper::checkForSavedSearch方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchHelper::checkForSavedSearch方法的具體用法?PHP SearchHelper::checkForSavedSearch怎麽用?PHP SearchHelper::checkForSavedSearch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::checkForSavedSearch方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveQuery
/**
* This method uses ajax to save the users query
*
* @author KnowledgeTree TEam
* @access public
* @static
* @param string $txtName The name of the saved search query
* @param string $txtQuery The search query
* @param string $userID The id of the user saving the query
* @return void
*/
public static function saveQuery($txtName, $txtQuery, $userID)
{
/* $lookup = sanitizeForSQL($txtName);
$sql = "select 1 from search_saved where name='$lookup'";
$result = DBUtil::getResultArray($sql);
*/
$result = SearchHelper::checkForSavedSearch($txtName);
if (PEAR::isError($result)) {
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_INTERNAL);
}
if (count($result) > 0) {
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_SAVED_SEARCH_EXISTS, _kt('Search with this name already exists'));
}
/* // autoInsert does escaping...
$values = array(
'name'=>$txtName,
'expression'=>$txtQuery,
'type'=>'S',
'shared'=>0,
'user_id' => $userID
);
$result = DBUtil::autoInsert('search_saved', $values);
*/
$result = SearchHelper::saveSavedSearch($txtName, $txtQuery, $userID);
if (PEAR::isError($result)) {
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_INTERNAL);
}
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_SUCCESS);
}