Skip to content

Commit

Permalink
Merge pull request #5 from rasstislav/patch-1
Browse files Browse the repository at this point in the history
fixed table name for the given class
  • Loading branch information
gurucomkz authored Mar 16, 2023
2 parents 02e195a + 3944a8b commit 4153bad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EagerLoadedDataList.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function eagerLoadHasOne(&$ids, $hasOnes, $withHasOnes)
$dep = $depSeq[0];
$fields[] = "\"{$dep}ID\"";
}
$table = Config::forClass($this->dataClass)->get('table_name');
$table = DataObject::getSchema()->tableName($this->dataClass);
$data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']);
$data = Utils::EnsureArray($data->execute(), 'ID');

Expand Down

0 comments on commit 4153bad

Please sign in to comment.