mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Added subquery argument support to more types of queries.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8565 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4b85afd9b3
commit
d248d70773
11 changed files with 232 additions and 32 deletions
|
|
@ -34,10 +34,7 @@
|
|||
function getArguments(){
|
||||
$arguments = array();
|
||||
foreach($this->conditions as $condition){
|
||||
if(is_a($condition, 'QueryTag'))
|
||||
$arguments = array_merge($arguments, $condition->getArguments());
|
||||
else
|
||||
$arguments[] = $condition->getArgument();
|
||||
}
|
||||
return $arguments;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,12 @@
|
|||
$this->pipe = $pipe;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return $this->argument;
|
||||
function getArguments(){
|
||||
$arguments = array();
|
||||
if($this->query)
|
||||
$arguments = array_merge($arguments, $this->query->getArguments());
|
||||
$arguments[] = $this->argument;
|
||||
return $arguments;
|
||||
}
|
||||
|
||||
function getConditionString(){
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ class QueryTag {
|
|||
$arguments = array();
|
||||
if($this->columns)
|
||||
$arguments = array_merge($arguments, $this->columns->getArguments());
|
||||
$arguments = array_merge($arguments, $this->tables->getArguments());
|
||||
$arguments = array_merge($arguments, $this->conditions->getArguments());
|
||||
$arguments = array_merge($arguments, $this->navigation->getArguments());
|
||||
return $arguments;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
var $alias;
|
||||
var $join_type;
|
||||
var $conditions;
|
||||
|
||||
var $conditionsTag;
|
||||
/**
|
||||
* @brief Initialises Table Tag properties
|
||||
* @param XML <table> tag $table
|
||||
|
|
@ -41,6 +41,9 @@
|
|||
$this->join_type = $table->attrs->type;
|
||||
|
||||
$this->conditions = $table->conditions;
|
||||
|
||||
if($this->isJoinTable())
|
||||
$this->conditionsTag = new JoinConditionsTag($this->conditions);
|
||||
}
|
||||
|
||||
function isJoinTable(){
|
||||
|
|
@ -66,16 +69,20 @@
|
|||
function getTableString(){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
if($this->isJoinTable()){
|
||||
$conditionsTag = new JoinConditionsTag($this->conditions);
|
||||
return sprintf('new JoinTable(\'%s\', \'%s\', "%s", %s)'
|
||||
, $dbParser->escape($this->name)
|
||||
, $dbParser->escape($this->alias)
|
||||
, $this->join_type, $conditionsTag->toString());
|
||||
, $this->join_type, $this->conditionsTag->toString());
|
||||
}
|
||||
return sprintf('new Table(\'%s\'%s)'
|
||||
, $dbParser->escape($this->name)
|
||||
, $this->alias ? ', \'' . $dbParser->escape($this->alias) .'\'' : '');
|
||||
}
|
||||
|
||||
function getArguments(){
|
||||
if(!isset($this->conditionsTag)) return array();
|
||||
return $this->conditionsTag->getArguments();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -53,5 +53,12 @@
|
|||
$output_tables .= ')';
|
||||
return $output_tables;
|
||||
}
|
||||
|
||||
function getArguments(){
|
||||
$arguments = array();
|
||||
foreach($this->tables as $table)
|
||||
$arguments = array_merge($arguments, $table->getArguments());
|
||||
return $arguments;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue