Commit 7af31c0c authored by zYne's avatar zYne

added getWords()

parent 309c2936
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment