new system-config to prevent overlapping records (#1720)
This commit is contained in:
@@ -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[]
|
||||
|
||||
Reference in New Issue
Block a user