public function getConfig() { $config = $this->configMapper->getByBackend($this->getId()); $defaultConfig = $this->getDefaultConfig(); $configNotInDB = array_diff_key($defaultConfig, $config); foreach ($configNotInDB as $key => $value) { $config[$key] = $value; } return $config; }
/** * @NoAdminRequired * @param $backends * @return JSONResponse */ public function set($backends) { foreach ($backends as $backend) { foreach ($backend['config'] as $key => $value) { $this->configMapper->set($backend['id'], $key, $value); } } $res = new JSONResponse(); $res->setStatus(Http::STATUS_OK); return $res; }