Skip to content

Commit c2cada2

Browse files
committed
replace aliasing for joins with more general character
1 parent eea7348 commit c2cada2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dba/AbstractModelFactory.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ private function filterWithJoin(array $options): array|AbstractModel {
638638
$k = strtolower($k);
639639
foreach ($factories as $factory) {
640640
if (Util::startsWith($k, strtolower($factory->getMappedModelTable()))) {
641-
$column = str_replace(strtolower($factory->getMappedModelTable()) . ".", "", $k);
641+
$column = str_replace(strtolower($factory->getMappedModelTable()) . "_", "", $k);
642642
$values[$factory->getModelTable()][strtolower($column)] = $v;
643643
}
644644
}

src/dba/Util.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function cast($obj, $to_class) {
3737
public static function createPrefixedString(string $table, array $keys): string {
3838
$arr = array();
3939
foreach ($keys as $key) {
40-
$arr[] = "$table.$key AS '$table.$key'";
40+
$arr[] = "$table.$key AS " . $table . "_" . $key;
4141
}
4242
return implode(", ", $arr);
4343
}

0 commit comments

Comments
 (0)