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