diff --git a/src/EagerLoadedDataList.php b/src/EagerLoadedDataList.php index a99179e..c7f6d37 100644 --- a/src/EagerLoadedDataList.php +++ b/src/EagerLoadedDataList.php @@ -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');