mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-28 23:59:57 +09:00
Update for query column list argument (selecting just certain columns from a table instead of all).
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8709 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c2f8aeb167
commit
bbe95e94ff
3 changed files with 90 additions and 75 deletions
|
|
@ -395,8 +395,8 @@
|
||||||
$output = $this->_executeDeleteAct($output);
|
$output = $this->_executeDeleteAct($output);
|
||||||
break;
|
break;
|
||||||
case 'select' :
|
case 'select' :
|
||||||
// TODO Add property for Query object for Arg_columns
|
$arg_columns = is_array($arg_columns)?$arg_columns:array();
|
||||||
$output->arg_columns = is_array($arg_columns)?$arg_columns:array();
|
$output->setColumnList($arg_columns);
|
||||||
$output = $this->_executeSelectAct($output);
|
$output = $this->_executeSelectAct($output);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function setColumnList($columnList){
|
function setColumnList($columnList){
|
||||||
$this->columnList = $columnList;
|
if(count($columnList) > 0)
|
||||||
|
$this->columnList = $columnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setColumns($columns){
|
function setColumns($columns){
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,20 @@
|
||||||
$this->assertEquals($output->data->module_srl, 111);
|
$this->assertEquals($output->data->module_srl, 111);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that when a column list is given, the query only selects those columns from the database
|
||||||
|
* insetad of retrieving all table columns (as specified in the xml query file)
|
||||||
|
*/
|
||||||
|
function test_get_module_by_mid_columnList(){
|
||||||
|
$args->mid = 'test_4l8ci4vv0n';
|
||||||
|
$args->site_srl = 0;
|
||||||
|
$output = executeQuery('module.getMidInfo', $args, array('module_srl'));
|
||||||
|
$this->assertNotNull($output);
|
||||||
|
$this->assertNotNull($output->data, $output->message . PHP_EOL . $output->variables["_query"]);
|
||||||
|
$this->assertEquals($output->data->module_srl, 111);
|
||||||
|
$this->assertEquals($output->data->module, null);
|
||||||
|
}
|
||||||
|
|
||||||
function test_module_getInfo(){
|
function test_module_getInfo(){
|
||||||
$args->site_srl = 0;
|
$args->site_srl = 0;
|
||||||
$output = executeQuery('module.getSiteInfo', $args);
|
$output = executeQuery('module.getSiteInfo', $args);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue