本文整理汇总了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);
}