From ed275f9c3461f045a8268b59311f5967eff1afa8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 11 Nov 2017 14:02:30 +0100 Subject: [PATCH] Fix pull out bug --- DataStorage/Database/Query/Grammar/Grammar.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/DataStorage/Database/Query/Grammar/Grammar.php b/DataStorage/Database/Query/Grammar/Grammar.php index 35ae35039..19484dbae 100644 --- a/DataStorage/Database/Query/Grammar/Grammar.php +++ b/DataStorage/Database/Query/Grammar/Grammar.php @@ -114,12 +114,13 @@ class Grammar extends GrammarAbstract protected function compileComponents(BuilderAbstract $query) : array { $sql = []; - $components = $this->getComponents($query->getType()); if($query->getType() === QueryType::RAW) { - return $components; + return [$query->raw]; } + $components = $this->getComponents($query->getType()); + /* Loop all possible query components and if they exist compile them. */ foreach ($components as $component) { if (isset($query->{$component}) && !empty($query->{$component})) { @@ -143,8 +144,6 @@ class Grammar extends GrammarAbstract return $components = $this->deleteComponents; case QueryType::RANDOM: return $components = $this->selectComponents; - case QueryType::RAW: - return [$query->raw]; default: throw new \InvalidArgumentException('Unknown query type.'); }