mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 14:22:54 +09:00
fix Argument and Condition argument type
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8562 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
909276e16b
commit
013ada255d
5 changed files with 61 additions and 41 deletions
|
|
@ -3,21 +3,13 @@
|
|||
class Argument {
|
||||
var $value;
|
||||
var $name;
|
||||
var $type;
|
||||
|
||||
var $isValid;
|
||||
var $errorMessage;
|
||||
|
||||
function Argument($name, $value){
|
||||
$this->name = $name;
|
||||
|
||||
if($this->type !== 'date'){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$this->value = $dbParser->escapeStringValue($value);
|
||||
}
|
||||
else
|
||||
$this->value = $value;
|
||||
|
||||
$this->value = $value;
|
||||
$this->name = $name;
|
||||
$this->isValid = true;
|
||||
}
|
||||
|
||||
|
|
@ -40,22 +32,14 @@
|
|||
}
|
||||
|
||||
function escapeValue($value){
|
||||
if(in_array($this->type, array('date', 'varchar', 'char','text', 'bigtext'))){
|
||||
if(!is_array($value))
|
||||
$value = '\''.$value.'\'';
|
||||
else {
|
||||
$total = count($value);
|
||||
for($i = 0; $i < $total; $i++)
|
||||
$value[$i] = '\''.$value[$i].'\'';
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function getType(){
|
||||
return $this->type;
|
||||
if(is_string($value)){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
return $dbParser->parseExpression($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
function isValid(){
|
||||
return $this->isValid;
|
||||
}
|
||||
|
|
@ -69,15 +53,7 @@
|
|||
$this->value = $default_value;
|
||||
}
|
||||
|
||||
function setColumnType($column_type){
|
||||
if(!isset($this->value)) return;
|
||||
if($column_type === '') return;
|
||||
|
||||
$this->type = $column_type;
|
||||
|
||||
//if($column_type === '') $column_type = 'varchar';
|
||||
|
||||
}
|
||||
|
||||
function checkFilter($filter_type){
|
||||
if(isset($this->value) && $this->value != ''){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue