public function FrxPostgres::data in Forena Reports 6.2
Same name and namespace in other branches
- 6 plugins/FrxPostgres.inc \FrxPostgres::data()
- 7 plugins/FrxPostgres.inc \FrxPostgres::data()
- 7.2 plugins/FrxPostgres.inc \FrxPostgres::data()
Get data based on file data block in the repository.
Parameters
String $block_name:
Array $parm_data:
Query $subQuery:
File
- plugins/
FrxPostgres.inc, line 58 - Oracle specific driver that takes advantage of oracles native XML support
Class
- FrxPostgres
- @file Oracle specific driver that takes advantage of oracles native XML support
Code
public function data($block_name, $params = array(), $clause = '') {
// Load the block from the file
$db = $this->db;
$block = $this
->load_block($block_name);
$xml = '';
if (@$block['source'] && $this
->access($block['access']) && $db) {
$sql = $block['source'];
if ($clause) {
$sql = 'SELECT * FROM (' . trim($sql, ' ;') . ') vvv ' . $clause;
}
$sql = $this->te
->replace($sql);
if ($this->use_postgres_xml) {
$xml = $this
->postgres_xml($sql, $block_name);
}
else {
$xml = $this
->php_xml($sql);
}
if ($this->debug) {
$d = '';
if ($xml) {
$d = htmlspecialchars($xml
->asXML());
}
$this
->debug('SQL: ' . $sql, '<pre> SQL:' . $sql . "\n XML: " . $d . "\n</pre>");
}
return $xml;
}
}