added project importer and grandtotal converter (#1468)
This commit is contained in:
@@ -20,24 +20,25 @@ use Doctrine\ORM\ORMException;
|
||||
*/
|
||||
class ConfigurationRepository extends EntityRepository implements ConfigLoaderInterface
|
||||
{
|
||||
private static $cacheByPrefix = null;
|
||||
private static $cacheByPrefix = [];
|
||||
private static $cacheAll = [];
|
||||
private static $initialized = false;
|
||||
|
||||
public function clearCache()
|
||||
{
|
||||
static::$cacheByPrefix = null;
|
||||
static::$cacheAll = null;
|
||||
static::$cacheByPrefix = [];
|
||||
static::$cacheAll = [];
|
||||
static::$initialized = false;
|
||||
}
|
||||
|
||||
private function prefillCache()
|
||||
{
|
||||
if (null !== static::$cacheByPrefix) {
|
||||
if (static::$initialized === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var Configuration[] $configs */
|
||||
$configs = $this->findAll();
|
||||
static::$cacheByPrefix = [];
|
||||
foreach ($configs as $config) {
|
||||
$key = substr($config->getName(), 0, strpos($config->getName(), '.'));
|
||||
if (!\array_key_exists($key, static::$cacheByPrefix)) {
|
||||
@@ -46,6 +47,7 @@ class ConfigurationRepository extends EntityRepository implements ConfigLoaderIn
|
||||
static::$cacheByPrefix[$key][] = $config;
|
||||
static::$cacheAll[] = $config;
|
||||
}
|
||||
static::$initialized = true;
|
||||
}
|
||||
|
||||
public function saveConfiguration(Configuration $configuration)
|
||||
|
||||
Reference in New Issue
Block a user