Creating an install data script (InstallData.php)
An install data script is what gets run immediately after upgrade schema. We define install data schema within the app/code/Foggyline/Office/Setup/InstallData.php
file with (partial) content as follows:
namespace Foggyline\Office\Setup; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements InstallDataInterface { private $employeeSetupFactory; public function __construct( \Foggyline\Office\Setup\EmployeeSetupFactory $employeeSetupFactory ) { $this->employeeSetupFactory = $employeeSetupFactory; } public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); /* #snippet1 */ $setup->endSetup(); } }
InstallData
conforms to InstallDataInterface
, which requires the implementation of the...