simplification du code
This commit is contained in:
@@ -226,31 +226,16 @@ class QueryBuilder
|
||||
|
||||
private function getClause(string $word, array $data): string
|
||||
{
|
||||
$ret = "";
|
||||
if (count($data) > 0) {
|
||||
$ret = " $word ";
|
||||
$iClause = 0;
|
||||
foreach ($data as $clause) {
|
||||
if ($iClause > 0) {
|
||||
$ret .= ",";
|
||||
if (!empty($data)) {
|
||||
return " $word " . implode(",", $data);
|
||||
}
|
||||
$ret .= $clause;
|
||||
$iClause++;
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
return "";
|
||||
}
|
||||
|
||||
private function getLimit(): string
|
||||
{
|
||||
if ($this->take !== null || $this->offset !== null) {
|
||||
$ret = "";
|
||||
if ($this->take !== null) {
|
||||
$ret = " LIMIT " . $this->take;
|
||||
}
|
||||
if ($this->offset !== null) {
|
||||
$ret .= " OFFSET " . $this->offset;
|
||||
}
|
||||
$ret = ($this->take !== null ? " LIMIT " . $this->take : "") . ($this->offset !== null ? " OFFSET " . $this->offset : "");
|
||||
return $ret;
|
||||
} else {
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user