Fixed condition group bug - if there are more condition groups and the first doesn't get displayed, the pipe of the next is printed even though it shouldn't have been.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8607 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-07-18 15:58:46 +00:00
parent ff679cc517
commit 0c63c32b10
4 changed files with 42 additions and 2 deletions

View file

@ -190,8 +190,15 @@
function getWhereString($with_values = true){
$where = '';
if(count($this->conditions) > 0){
$condition_count = 0;
foreach($this->conditions as $conditionGroup){
$where .= $conditionGroup->toString($with_values);
$condition_string = $conditionGroup->toString($with_values);
if($condition_string !== '') $condition_count++;
if($condition_count === 1){
$conditionGroup->setPipe("");
$condition_string = $conditionGroup->toString($with_values);
}
$where .= $condition_string;
}
if(trim($where) == '') return '';