public function DataManager::buildSQL in Forena Reports 8
Same name and namespace in other branches
- 7.5 src/DataManager.php \Drupal\forena\DataManager::buildSQL()
Build an SQL statement from the data provider
Parameters
string $provider: Data provider name
array $builder: Build information.
Return value
string SQL query.
File
- src/
DataManager.php, line 311 - DataManager.inc Enter description here ... @author davidmetzler
Class
Namespace
Drupal\forenaCode
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 (!empty($builder['where'])) {
$sql .= "WHERE " . $o
->buildFilterSQL($builder['where']);
}
return $sql;
}