From 7af31c0c51fe47516420326cf1080254a3545f43 Mon Sep 17 00:00:00 2001 From: zYne Date: Sun, 18 Nov 2007 17:44:47 +0000 Subject: [PATCH] added getWords() --- lib/Doctrine/Search/Query.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Search/Query.php b/lib/Doctrine/Search/Query.php index dab747292..6bf7378a1 100644 --- a/lib/Doctrine/Search/Query.php +++ b/lib/Doctrine/Search/Query.php @@ -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;