-
Notifications
You must be signed in to change notification settings - Fork 2
Admin Config
Code Slicer edited this page Sep 15, 2022
·
4 revisions
Handles core_config_data (admin config related fields) changes. Import it as follows:
private Migration\Facade\AdminConfig $adminConfig;
public function __construct(
Migration\Context $context,
Migration\Facade\AdminConfig $adminConfig
) {
parent::__construct($context);
$this->adminConfig = $adminConfig;
}
Retrieve existing config for given path:
$username = $this->adminConfig->get('my/module/user');
Overrides existing entry, or create a new one if needed.
$this->adminConfig->set('payment/creditcard/identifier', 'My Store');
Equivalent to checking the "restore" checkbox on admin. Force the setting to fallback to its default (defined on some config.xml):
$this->adminConfig->reset('shipping/carrier/show_foo_in_checkout');
That's an odd one. It allows appending a value to a given setting. Useful for managing the html scripts theme field and similar ones.
$this->adminConfig->append('design/head/includes', <<<HTML
<script src="https://another.slow.chat/script.js" async></script>
HTML);
We want YOU for our community 🫵