| Current Path : /var/www/html/app/code/FlipsDigital/CustomerTextbookList/Setup/ |
| Current File : /var/www/html/app/code/FlipsDigital/CustomerTextbookList/Setup/InstallData.php |
<?php
/**
* InstallData
*
* @copyright Copyright © 2021 FlipsDigital. All rights reserved.
* @author calvin.so@flipsdigital.com
*/
namespace FlipsDigital\CustomerTextbookList\Setup;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface
{
/**
* CustomerTextbookList setup factory
*
* @var CustomerTextbookListSetupFactory
*/
protected $customertextbooklistSetupFactory;
/**
* Init
*
* @param CustomerTextbookListSetupFactory $customertextbooklistSetupFactory
*/
public function __construct(CustomerTextbookListSetupFactory $customertextbooklistSetupFactory)
{
$this->customertextbooklistSetupFactory = $customertextbooklistSetupFactory;
}
/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) //@codingStandardsIgnoreLine
{
/** @var CustomerTextbookListSetup $customertextbooklistSetup */
$customertextbooklistSetup = $this->customertextbooklistSetupFactory->create(['setup' => $setup]);
$setup->startSetup();
$customertextbooklistSetup->installEntities();
$entities = $customertextbooklistSetup->getDefaultEntities();
foreach ($entities as $entityName => $entity) {
$customertextbooklistSetup->addEntityType($entityName, $entity);
}
$setup->endSetup();
}
}