@@ -42,13 +42,18 @@ public static function __callStatic(string \$name, array \$args): string
4242 \$e = constant("self:: \$name");
4343 [ \$fA, \$tA] = \$args + [null, null];
4444 if (! \$fA && ! \$tA) return \$e;
45- [ \$f, \$t] = explode('__', substr( \$name, 4), 2);
46- return str_replace([ \$f . '.', \$t . '.'], [ \$fA ? \$fA . '.' : \$f . '.', \$tA ? \$tA . '.' : \$t . '.'], \$e);
45+ [ \$left, \$right] = explode('=', \$e, 2);
46+ [ \$fromTable, \$fromCol] = array_map('trim', explode('.', \$left, 2));
47+ [ \$toTable, \$toCol] = array_map('trim', explode('.', \$right, 2));
48+ \$fromTable = \$fA ?? \$fromTable;
49+ \$toTable = \$tA ?? \$toTable;
50+ return "{ \$fromTable}.{ \$fromCol} = { \$toTable}.{ \$toCol}";
4751 }
48- if (defined("self::" . strtoupper( \$name))) {
52+
53+ if (defined("self::" . \$name)) {
4954 return ( \$a = \$args[0] ?? null) ? " \$name AS \$a" : \$name;
5055 }
51- throw new \\ BadMethodCallException("Undefined Tbl helper: \$name");
56+ throw new \BadMethodCallException("Undefined Tbl helper: \$name");
5257 }
5358
5459PHP ;
0 commit comments