mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
Started unit tests for correlated subqueries - select, from, where.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8557 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1353ade0c2
commit
e313076cc8
7 changed files with 147 additions and 14 deletions
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @class TableTag
|
||||
* @author Arnia Sowftare
|
||||
* @brief Models the <table> tag inside an XML Query file
|
||||
|
|
@ -26,17 +25,22 @@
|
|||
var $join_type;
|
||||
var $conditions;
|
||||
|
||||
/**
|
||||
* @brief Initialises Table Tag properties
|
||||
* @param XML <table> tag $table
|
||||
*/
|
||||
function TableTag($table){
|
||||
$this->unescaped_name = $table->attrs->name;
|
||||
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
|
||||
$this->unescaped_name = $table->attrs->name;
|
||||
$this->name = $dbParser->parseTableName($table->attrs->name);
|
||||
$this->alias = $table->attrs->alias;
|
||||
|
||||
$this->alias = $table->attrs->alias;
|
||||
if(!$this->alias) $this->alias = $table->attrs->name;
|
||||
//if(!$this->alias) $this->alias = $alias;
|
||||
|
||||
$this->join_type = $table->attrs->type;
|
||||
$this->conditions = $table->conditions;
|
||||
|
||||
$this->conditions = $table->conditions;
|
||||
}
|
||||
|
||||
function isJoinTable(){
|
||||
|
|
@ -53,6 +57,12 @@
|
|||
return $this->unescaped_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns string for printing in PHP query cache file
|
||||
* The string contains code for instantiation of either
|
||||
* a Table or a JoinTable object
|
||||
* @return string
|
||||
*/
|
||||
function getTableString(){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
if($this->isJoinTable()){
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @class TablesTag
|
||||
* @author Arnia Sowftare
|
||||
* @brief Models the <tables> tag inside an XML Query file
|
||||
*
|
||||
* @abstract
|
||||
* Example
|
||||
* <tables>
|
||||
* <table name="documents" alias="doc" />
|
||||
* </tables>
|
||||
* Attributes
|
||||
* None.
|
||||
* Children
|
||||
* Can have children of type <table> or <query>
|
||||
*/
|
||||
|
||||
class TablesTag {
|
||||
var $tables;
|
||||
|
||||
|
|
@ -16,8 +32,7 @@
|
|||
if(count($xml_tables)) require_once(_XE_PATH_.'classes/xml/xmlquery/tags/table/TableTag.class.php');
|
||||
|
||||
foreach($xml_tables as $table){
|
||||
if($table->name === 'query') $this->tables[] = new QueryTag($table, true);
|
||||
else $this->tables[] = new TableTag($table);
|
||||
$this->tables[] = new TableTag($table);
|
||||
}
|
||||
}
|
||||
if(!$xml_queries) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue