added project importer and grandtotal converter (#1468)

This commit is contained in:
Kevin Papst
2020-10-11 22:08:00 +02:00
committed by GitHub
parent 0ce02b4f06
commit 996f05c73a
68 changed files with 2827 additions and 384 deletions

View File

@@ -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)