cvs: pear /Search_Mnogosearch Mnogosearch.php
| From: | Carsten Bleek | Date: | Fri, 16 Sep 2005 17:17:26 +0000 |
| Subject: | cvs: pear /Search_Mnogosearch Mnogosearch.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-34803@lists.php.net to get a copy of this message | ||
cbleek Fri Sep 16 13:17:26 2005 EDT
Modified files:
/pear/Search_Mnogosearch Mnogosearch.php
Log:
params was not set when using setParameter()
http://cvs.php.net/diff.php/pear/Search_Mnogosearch/Mnogosearch.php?r1=1.8&r2=1.9&ty=u
Index: pear/Search_Mnogosearch/Mnogosearch.php
diff -u pear/Search_Mnogosearch/Mnogosearch.php:1.8 pear/Search_Mnogosearch/Mnogosearch.php:1.9
--- pear/Search_Mnogosearch/Mnogosearch.php:1.8 Sun Jul 24 03:59:36 2005
+++ pear/Search_Mnogosearch/Mnogosearch.php Fri Sep 16 13:17:23 2005
@@ -16,7 +16,7 @@
// | Gerrit Goetsch <goetsch@cross-solution.de> |
// +----------------------------------------------------------------------+
//
-// $Id: Mnogosearch.php,v 1.8 2005/07/24 07:59:36 cbleek Exp $
+// $Id: Mnogosearch.php,v 1.9 2005/09/16 17:17:23 cbleek Exp $
/**
* This File contains the class Search_Mnogosearch.
@@ -120,7 +120,7 @@
* @license http://www.php.net/license/2_02.txt
PHP License 2.02
* @package Search_Mnogosearch
* @category Search
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
class Search_Mnogosearch {
@@ -332,7 +332,6 @@
function setParameters($params = array())
{
foreach ($params as $key => $value) {
- $this->params[$key]=$value;
$this->setParameter($key, $value);
}
} // end func setParameters
@@ -491,18 +490,23 @@
$name = $this->_getUdmParameter($param);
switch ($name) {
case UDM_PARAM_PAGE_SIZE :
+ $this->params[ UDM_PARAM_PAGE_SIZE ] = (int) $value;
$this->_resultsPerPage = (int) $value;
break;
case UDM_PARAM_PAGE_NUM :
+ $this->params[ UDM_PARAM_PAGE_NUM ] = (int) $value;
$this->_pageNumber = (int) $value;
break;
case UDM_PARAM_HLBEG :
+ $this->params[ UDM_PARAM_HLBEG ] = $value;
$this->_hlbeg = $value;
break;
case UDM_PARAM_HLEND :
+ $this->params[ UDM_PARAM_HLEND ] = $value;
$this->_hlend = $value;
break;
case UDM_PARAM_SEARCH_MODE :
+ $this->params[ UDM_PARAM_SEARCH_MODE ] = $value;
$this->searchModeFlag = true;
break;
case UDM_PARAM_DATE_FORMAT :
@@ -515,6 +519,7 @@
$value = constant($value);
}
$error = udm_set_agent_param($this->agent, $constant, $value);
+
if (!$error) {
return PEAR::raiseError(
"Error while setting '$constant' parameter.",
@@ -543,6 +548,7 @@
"Error while setting '$constant' parameter.",
SEARCH_MNOGOSEARCH_ERROR, PEAR_ERROR_RETURN);
}
+ $this->params[ $constant ] = $value;
return true;
} // end func setParameter_ex
@@ -585,6 +591,7 @@
}
$res = udm_find($this->agent, $this->query);
+
if (($error = udm_error($this->agent)) != '') {
udm_free_res($res);
return PEAR::raiseError(
@@ -592,6 +599,7 @@
}
$found = udm_get_res_param($res, UDM_PARAM_FOUND);
$result = array();
+
if (!$found) {
if (strtolower($this->params[ UDM_PARAM_SUGGEST ])=='yes') {
if (Udm_Api_Version() >= 30233) {
@@ -956,6 +964,12 @@
$renderer->finishForm($this);
} // end func accept
+ /**
+ * Returns word suggestions
+ *
+ * @return string Word suggestions
+ * @access public
+ */
function getSuggest(){
if (empty($this->_suggest)){
return false;