This commit is contained in:
mcndave committed 2020-10-06 17:55:31 +00:00
commit 6f558f2923
19 files changed
+592 -264

No files matched your search

+6 -2
View File
@@ -50,14 +50,14 @@ class Where extends Fragment {
return $this;
}
public function render() : string
public function render(bool $skipToken = false) : string
{
$stack = [];
foreach ($this->conditionList ?? [] as $key => $item) {
if ( $item instanceof Where ) {
if ( $item->conditionList ?? false ) {
$stack[] = ( $key !== 0 ? "{$item->condition} " : "" ) . "(" . $item->render() . ")";
$stack[] = ( $key !== 0 ? "{$item->condition} " : "" ) . "(" . $item->render($skipToken) . ")";
}
}
else {
@@ -67,7 +67,11 @@ class Where extends Fragment {
}
return $this->renderSegments([
! $this->parent && ! empty($this->conditionList) ? static::SQL_TOKEN : "",
=======
! $this->parent && ! $skipToken ? static::SQL_TOKEN : "",
>>>>>>> 27d5fd0b08b98f6fda3b8a6682b2dd7c7a692d82
implode(" ", $stack)
]);
}