mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 19:51:42 +09:00
Removed legacy methods from DB and DBCubrid classes.
Added Query object to hold together query parts. Updated structure of query cache file to return Query object. Added support for array query arguments - used in the IN clause. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8438 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c384f6c753
commit
0cd318fcf5
9 changed files with 210 additions and 891 deletions
|
|
@ -127,20 +127,20 @@ class QueryParser {
|
|||
$prebuff .= "\n";
|
||||
|
||||
$buff = '';
|
||||
|
||||
$buff .= '$output->columns = ' . $columns->toString() . ';'.PHP_EOL;
|
||||
$buff .= '$output->tables = ' . $tables->toString() .';'.PHP_EOL;
|
||||
$buff .= '$output->conditions = '.$conditions->toString() .';'.PHP_EOL;
|
||||
$buff .= '$output->groups = ' . $groups->toString() . ';';
|
||||
$buff .= '$output->orderby = ' . $navigation->getOrderByString() .';';
|
||||
$buff .= $navigation->getLimitString()?'$output->limit = ' . $navigation->getLimitString() .';':"";
|
||||
$buff .= '$query->setColumns(' . $columns->toString() . ');'.PHP_EOL;
|
||||
$buff .= '$query->setTables(' . $tables->toString() .');'.PHP_EOL;
|
||||
$buff .= '$query->setConditions('.$conditions->toString() .');'.PHP_EOL;
|
||||
$buff .= '$query->setGroups(' . $groups->toString() . ');'.PHP_EOL;
|
||||
$buff .= '$query->setOrder(' . $navigation->getOrderByString() .');'.PHP_EOL;
|
||||
$buff .= $navigation->getLimitString()?'$query->setLimit(' . $navigation->getLimitString() .');'.PHP_EOL:"";
|
||||
|
||||
return "<?php if(!defined('__ZBXE__')) exit();\n"
|
||||
. sprintf('$output->query_id = "%s";%s', $this->query_id, "\n")
|
||||
. sprintf('$output->action = "%s";%s', $this->action, "\n")
|
||||
. '$query = new Query();'.PHP_EOL
|
||||
. sprintf('$query->setQueryId("%s");%s', $this->query_id, "\n")
|
||||
. sprintf('$query->setAction("%s");%s', $this->action, "\n")
|
||||
. $prebuff
|
||||
. $buff
|
||||
. 'return $output; ?>';
|
||||
. 'return $query; ?>';
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue