public function FrxRepoMan::buildSQL in Forena Reports 7.4
Same name and namespace in other branches
- 7.3 FrxRepoMan.inc \FrxRepoMan::buildSQL()
Build an SQL statement from the data provider
Parameters
$provider string data provider name:
$builder Array containing build information.:
File
- ./
FrxRepoMan.inc, line 295 - FrxRepoMan.inc Enter description here ... @author davidmetzler
Class
- FrxRepoMan
- @file FrxRepoMan.inc Enter description here ... @author davidmetzler
Code
public function buildSQL($provider, $builder) {
$repos = @$this->repositories[$provider];
if (isset($repos['enabled']) && !$repos['enabled']) {
return '';
}
$o = $this
->repository($provider);
$sql = "SELECT * FROM (\n";
$sql .= '--INCLUDE=' . $builder['block_name'] . "\n";
$sql .= ") t\n";
if (@$builder['where']) {
$sql .= "WHERE " . $o
->buildFilterSQL($builder['where']);
}
return $sql;
}