public function buildSql($offset = null, $limit = null, $isSelect = false)
{
is_null($offset) || $this->limit($offset, $limit);
$this->sql['columns'] == '' && ($this->sql['columns'] = '*');
$columns = $this->sql['columns'];
$tableAndCacheKey = $this->tableFactory();
empty($this->sql['limit']) && ($this->sql['limit'] = "LIMIT 0, 100");
$sql = "SELECT {$columns} FROM {$tableAndCacheKey[0]} " . $this->sql['where'] . $this->sql['groupBy'] . $this->sql['having'] . $this->sql['orderBy'] . $this->union . $this->sql['limit'];
if ($isSelect) {
return [$sql, $tableAndCacheKey[1]];
} else {
$this->currentSql = $sql;
$sql = $this->buildDebugSql();
$this->reset();
$this->clearBindParams();
$this->currentSql = '';
return " ({$sql}) ";
}
}