September 2018
Beginner to intermediate
218 pages
4h 27m
English
Let's create the <MAGELICIOUS_DIR>/Core/Setup/UpgradeData.php file with the following content:
use Magento\Framework\Setup\ModuleContextInterface;use Magento\Framework\Setup\ModuleDataSetupInterface;class UpgradeData implements \Magento\Framework\Setup\UpgradeDataInterface { public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); if (version_compare($context->getVersion(), '2.0.2') < 0) { $this->upgradeToVersionTwoZeroTwo($setup); } $setup->endSetup(); } private function upgradeToVersionTwoZeroTwo(ModuleDataSetupInterface $setup) { echo 'UpgradeData->upgradeToVersionTwoZeroTwo()' . PHP_EOL; }}
Let's go ahead and replace the echo line with something practical, ...
Read now
Unlock full access