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