The RecurringData script

Much like recurring scripts, the RecurringData scripts are rarely used in Magento. They also execute on each and every setup:upgrade command, regardless of the schema_version or data_version logged against the setup_module table. Magento Open Source uses merely three RecurringData scripts throughout its codebase.

Let's create the <MAGELICIOUS_DIR>/Core/Setup/RecurringData.php file with the following content:

use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

class RecurringData implements InstallDataInterface {
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
$setup->startSetup();
echo 'RecurringData->install()' . PHP_EOL;
$setup->endSetup();
}
}

The setup scripts provide a way for us to manage the data and its representation in the database. Whereas adding a new attribute to simple model is likely a case of extending its table by an extra column (*Schema scripts), adding a new attribute to an EAV model is a matter of adding new data under the eav_attribute table (*Data scripts).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.100.120