pohodaConnector = ServiceContainer::getService(PohodaConnector::class); $dbcfg = \Settings::getDefault(); if (empty($dbcfg->loadValue('pohoda'))) { \Settings::getDefault()->saveValue('pohoda', []); } $pohoda = $dbcfg->loadValue('pohoda') ?: []; $pohoda['mservers'][] = [ 'active' => 'Y', 'url' => $url, 'username' => $username, 'password' => $passwd, 'server_name' => '123', 'ico' => $ico, 'maintenanceFrom' => '', 'maintenanceTo' => '', 'productsIn' => [ 'last_sync' => '13.5.2021 16:12:59', 'internet' => 'N', ], 'ordersOut' => [ 'last_sync' => '13.5.2021 17:28:09', 'last_sync_diff' => '', ], 'issuedInvoiceIn' => [ 'last_sync' => '', 'last_sync_diff' => '', ], 'dev_activate' => 'Y', 'usersOut' => [ 'last_sync' => '13.5.2021 17:28:09', 'last_sync_diff' => '', ], ]; $dbcfg->updateValue('pohoda', $pohoda); $this->pohodaConnector->reloadConfig(); } }