This commit is contained in:
Daniil Gentili 2024-03-26 18:45:50 +01:00
parent 82e1e52f09
commit 51b6a519ca

View File

@ -36,7 +36,7 @@ trait DbAutoProperties
/** /**
* Initialize database properties. * Initialize database properties.
*/ */
public function initDbProperties(FieldConfig $config): void public function initDbProperties(Settings $settings, string $tablePrefix): void
{ {
$this->properties = []; $this->properties = [];
$promises = []; $promises = [];
@ -47,7 +47,6 @@ trait DbAutoProperties
} }
$attr = $attr[0]->newInstance(); $attr = $attr[0]->newInstance();
$settings = $config->settings;
if ($settings instanceof DriverSettings) { if ($settings instanceof DriverSettings) {
$ttl = $attr->cacheTtl ?? $settings->cacheTtl; $ttl = $attr->cacheTtl ?? $settings->cacheTtl;
if ($ttl !== $settings->cacheTtl) { if ($ttl !== $settings->cacheTtl) {
@ -69,7 +68,7 @@ trait DbAutoProperties
} }
$config = new FieldConfig( $config = new FieldConfig(
$config->table.'_'.($attr->tablePostfix ?? $property->getName()), $tablePrefix.($attr->tablePostfix ?? $property->getName()),
$settings, $settings,
$attr->keyType, $attr->keyType,
$attr->valueType, $attr->valueType,