new system-config to prevent overlapping records (#1720)

This commit is contained in:
Kevin Papst
2020-06-28 22:09:50 +02:00
committed by GitHub
parent e566305426
commit e22830790b
17 changed files with 246 additions and 20 deletions

View File

@@ -20,9 +20,10 @@ class ConfigurationRepository extends EntityRepository implements ConfigLoaderIn
private static $cacheByPrefix = null;
private static $cacheAll = [];
private function clearCache()
public function clearCache()
{
static::$cacheByPrefix = null;
static::$cacheAll = null;
}
private function prefillCache()
@@ -44,6 +45,14 @@ class ConfigurationRepository extends EntityRepository implements ConfigLoaderIn
}
}
public function saveConfiguration(Configuration $configuration)
{
$entityManager = $this->getEntityManager();
$entityManager->persist($configuration);
$entityManager->flush();
$this->clearCache();
}
/**
* @param string $prefix
* @return Configuration[]