Created
May 14, 2019 08:48
-
-
Save 6ui11em/2fcbf696e89a5be76e9eba530ee07e2c to your computer and use it in GitHub Desktop.
Magento 2: installData core_config_data #magento2, #installdata, #config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* InstallData | |
* | |
* @copyright Copyright © 2019 The Etailers. All rights reserved. | |
* @author [email protected] | |
*/ | |
namespace FERR\AlternateHreflang\Setup; | |
use Magento\Framework\Setup\InstallDataInterface; | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\ModuleDataSetupInterface; | |
/** | |
* @codeCoverageIgnore | |
*/ | |
class InstallData implements InstallDataInterface | |
{ | |
/** | |
* {@inheritdoc} | |
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) | |
*/ | |
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) | |
{ | |
$setup->startSetup(); | |
$data = [ | |
'scope' => 'default', | |
'scope_id' => 0, | |
'path' => 'path/to/config_param', | |
'value' => 'value', | |
]; | |
$setup->getConnection() | |
->insertOnDuplicate($setup->getTable('core_config_data'), $data, ['value']); | |
$setup->endSetup(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment