Skip to content

Commit

Permalink
FIX Keep the alias for plain table names
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-rainville committed Jul 25, 2024
1 parent b9d3ced commit 732d8f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ORM/Queries/SQLConditionalExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ public function addFrom($from)
if (is_array($from)) {
$this->from = array_merge($this->from, $from);
} elseif (!empty($from)) {
$this->from[] = $from;
// $this->from[str_replace(['"','`'], '', $from)] = $from;
if (preg_match('/"?([a-zA-Z0-9_]+)"?/', $from)) {
$this->from[str_replace(['"','`'], '', $from)] = $from;
} else {
$this->from[] = $from;
}
}

return $this;
Expand Down

0 comments on commit 732d8f9

Please sign in to comment.