Skip to content

Commit aa887b6

Browse files
authored
Connection prefix support (#865)
1 parent a3243c1 commit aa887b6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Drivers/EloquentEntitySet.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ public function getModelByKey(PropertyValue $key): ?Model
155155
*/
156156
public function getTable(): string
157157
{
158-
return $this->getModel()->getTable();
158+
$modelConnection = $this->getConnection();
159+
$prefix = "";
160+
if (method_exists($modelConnection, 'getTablePrefix')) {
161+
$prefix = $modelConnection->getTablePrefix();
162+
}
163+
164+
return $prefix . $this->getModel()->getTable();
159165
}
160166

161167
/**

0 commit comments

Comments
 (0)