mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Allow nested condition groups
XML 쿼리에서 <conditions><group> 안에 <group> 태그를 또 쓸 수 있도록 허용함. 이제 WHERE (a AND (b OR (c AND d))) 이런 조건을 작성할 수 있음.
This commit is contained in:
parent
2cfb7585af
commit
3359431d08
3 changed files with 48 additions and 13 deletions
|
|
@ -105,11 +105,24 @@ class ConditionGroup
|
|||
{
|
||||
$args = array();
|
||||
foreach($this->conditions as $condition)
|
||||
{
|
||||
$arg = $condition->getArgument();
|
||||
if($arg)
|
||||
{
|
||||
if($condition instanceof ConditionGroup)
|
||||
{
|
||||
foreach($condition->getArguments() as $arg)
|
||||
{
|
||||
if($arg)
|
||||
{
|
||||
$args[] = $arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$args[] = $arg;
|
||||
$arg = $condition->getArgument();
|
||||
if($arg)
|
||||
{
|
||||
$args[] = $arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $args;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue