mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Update to array condition arguments.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8602 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9606e263e8
commit
bf1d72e478
3 changed files with 24 additions and 25 deletions
|
|
@ -31,20 +31,6 @@
|
||||||
case 'like' :
|
case 'like' :
|
||||||
$this->value = '%'.$value.'%';
|
$this->value = '%'.$value.'%';
|
||||||
break;
|
break;
|
||||||
case 'in' :
|
|
||||||
if(is_array($value))
|
|
||||||
{
|
|
||||||
//$value = $this->addQuotesArray($value);
|
|
||||||
if($this->getType() == 'number')
|
|
||||||
$this->value = "(" . join(',',$value) . ")";
|
|
||||||
else
|
|
||||||
$this->value = "('". join("','",$value)."')";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->value = $value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
//if(!in_array($operation,array('in','notin','between')) && is_array($value)){
|
//if(!in_array($operation,array('in','notin','between')) && is_array($value)){
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,19 @@ class ConditionTest extends CubridTest {
|
||||||
|
|
||||||
$this->assertEquals('', $tag->toString());
|
$this->assertEquals('', $tag->toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks "in" operation
|
||||||
|
*/
|
||||||
|
public function testConditionString_In_VarcharArray() {
|
||||||
|
$member_srl_argument = new ConditionArgument('"member_srl"', array('a', 'b', 'c'), 'in');
|
||||||
|
$member_srl_argument->createConditionValue();
|
||||||
|
$member_srl_argument->setColumnType('varchar');
|
||||||
|
|
||||||
|
$tag = new Condition('"member_srl"', $member_srl_argument, 'in');
|
||||||
|
|
||||||
|
$this->assertEquals(' "member_srl" in (\'a\',\'b\',\'c\')', $tag->toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue