Updated query classes in order to support prepared statements - added support for parameter binding. Added unit tests for mssql select using new prepared statement syntax.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8511 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-06-20 14:03:27 +00:00
parent 32fe8750e9
commit 6f17aa5759
11 changed files with 93 additions and 16 deletions

View file

@ -11,12 +11,8 @@
var $orderby;
var $limit;
var $arguments = array();
function addArgument($argument){
$this->arguments[] = $argument;
}
var $arguments = null;
function setQueryId($queryID){
$this->queryID = $queryID;
}
@ -202,6 +198,35 @@
function getFirstTableName(){
return $this->tables[0]->getName();
}
function getArguments(){
if(!isset($this->arguments)){
$this->arguments = array();
// Column arguments
foreach($this->columns as $column){
if($column->show()){
$arg = $column->getArgument();
if($arg) $this->arguments[] = $arg;
}
}
// Condition arguments
if(count($this->conditions) > 0)
foreach($this->conditions as $conditionGroup){
$args = $conditionGroup->getArguments();
if(count($args) > 0) $this->arguments = array_merge($this->arguments, $args);
}
// Navigation arguments
if(count($this->orderby) > 0)
foreach($this->orderby as $order){
$args = $order->getArguments();
if(count($args) > 0) $this->arguments = array_merge($this->arguments, $args);
}
}
return $this->arguments;
}
}