1
0
mirror of synced 2024-12-13 14:56:01 +03:00

added getWords()

This commit is contained in:
zYne 2007-11-18 17:44:47 +00:00
parent 309c2936f7
commit 7af31c0c51

View File

@ -42,6 +42,8 @@ class Doctrine_Search_Query
protected $_params = array();
protected $_words = array();
protected $_condition;
@ -195,24 +197,31 @@ class Doctrine_Search_Query
}
return $where;
}
public function parseWord($word)
public function parseWord($word)
{
$this->_words[] = str_replace('*', '', $word);
if (strpos($word, '?') !== false ||
strpos($word, '*') !== false) {
$word = str_replace('*', '%', $word);
$where = 'keyword LIKE ?';
$params = array($word);
} else {
$where = 'keyword = ?';
}
$this->_params[] = $word;
return $where;
}
public function getWords()
{
return $this->_words;
}
public function getParams()
{
return $this->_params;