mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 02:10:02 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8458 201d5d3c-b55e-5fd7-737f-ddc643e51545
35 lines
No EOL
747 B
PHP
35 lines
No EOL
747 B
PHP
<?php
|
|
|
|
class ConditionGroup {
|
|
var $conditions;
|
|
var $pipe;
|
|
|
|
function ConditionGroup($conditions, $pipe = "") {
|
|
$this->conditions = $conditions;
|
|
$this->pipe = $pipe;
|
|
}
|
|
|
|
function toString($with_value = true){
|
|
if($this->pipe !== "")
|
|
$group = $this->pipe .' (';
|
|
else $group = '';
|
|
|
|
$cond_indx = 0;
|
|
|
|
foreach($this->conditions as $condition){
|
|
if($condition->show()){
|
|
if($cond_indx === 0) $condition->setPipe("");
|
|
$group .= $condition->toString($with_value) . ' ';
|
|
$cond_indx++;
|
|
}
|
|
}
|
|
// If the group has no conditions in it, return ''
|
|
if($cond_indx === 0) return '';
|
|
|
|
if($this->pipe !== "")
|
|
$group .= ')';
|
|
|
|
return $group;
|
|
}
|
|
}
|
|
?>
|