mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 04:09:55 +09:00
merge branche 1.5.0 to trunk (~r10525)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@10534 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
361cd64c16
commit
c9047de30d
15 changed files with 643 additions and 195 deletions
|
|
@ -20,7 +20,9 @@ class Argument {
|
|||
|
||||
function getType() {
|
||||
if (isset($this->type))
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
if (is_string($this->value))
|
||||
return 'column_name';
|
||||
return 'number';
|
||||
|
|
@ -29,7 +31,7 @@ class Argument {
|
|||
function setColumnType($value) {
|
||||
$this->type = $value;
|
||||
}
|
||||
|
||||
|
||||
function setColumnOperation($operation) {
|
||||
$this->column_operation = $operation;
|
||||
}
|
||||
|
|
@ -92,7 +94,7 @@ class Argument {
|
|||
if ($column_type == 'number') {
|
||||
if (is_array($value)) {
|
||||
foreach ($value AS $key => $val) {
|
||||
if (isset($val)) {
|
||||
if (isset($val) && $val !== '') {
|
||||
$value[$key] = (int) $val;
|
||||
}
|
||||
}
|
||||
|
|
@ -113,6 +115,13 @@ class Argument {
|
|||
function isValid() {
|
||||
return $this->isValid;
|
||||
}
|
||||
|
||||
function isColumnName(){
|
||||
$type = $this->getType();
|
||||
if($type == 'column_name') return true;
|
||||
if($type == 'number' && !is_numeric($this->value) && $this->uses_default_value) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function getErrorMessage() {
|
||||
return $this->errorMessage;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
|
||||
function ConditionArgument($name, $value, $operation){
|
||||
if(isset($value) && in_array($operation, array('in', 'notin', 'between')) && !is_array($value)){
|
||||
$value = str_replace(' ', '', $value);
|
||||
$value = str_replace('\'', '', $value);
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
if(isset($value) && in_array($operation, array('in', 'notin', 'between')) && !is_array($value) && $value != ''){
|
||||
$value = str_replace(' ', '', $value);
|
||||
$value = str_replace('\'', '', $value);
|
||||
$value = explode(',', $value);
|
||||
}
|
||||
parent::Argument($name, $value);
|
||||
$this->operation = $operation;
|
||||
}
|
||||
|
|
@ -63,22 +63,33 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Since ConditionArgument is used in WHERE clause,
|
||||
* where the argument value is compared to a table column,
|
||||
* it is assumed that all arguments have type. There are cases though
|
||||
* where the column does not have any type - if it was removed from
|
||||
* the XML schema for example - see the is_secret column in xe_documents table.
|
||||
* In this case, the column type is retrieved according to argument
|
||||
* value type (using the PHP function is_numeric).
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
function getType(){
|
||||
return $this->type ? $this->type : (!is_numeric($this->value) ? "varchar" : "");
|
||||
/**
|
||||
* Since ConditionArgument is used in WHERE clause,
|
||||
* where the argument value is compared to a table column,
|
||||
* it is assumed that all arguments have type. There are cases though
|
||||
* where the column does not have any type - if it was removed from
|
||||
* the XML schema for example - see the is_secret column in xe_documents table.
|
||||
* In this case, the column type is retrieved according to argument
|
||||
* value type (using the PHP function is_numeric).
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
function getType(){
|
||||
if($this->type)
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
else if(!is_numeric($this->value))
|
||||
{
|
||||
return 'varchar';
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function setColumnType($column_type){
|
||||
function setColumnType($column_type){
|
||||
if(!isset($this->value)) return;
|
||||
if($column_type === '') return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue