Your IP : 216.73.216.220


Current Path : /var/www/html/app/code/FlipsDigital/TextbookListBook/Setup/
Upload File :
Current File : /var/www/html/app/code/FlipsDigital/TextbookListBook/Setup/InstallData.php

<?php
/**
 * InstallData
 *
 * @copyright Copyright © 2021 FlipsDigital. All rights reserved.
 * @author    calvin.so@flipsdigital.com
 */

namespace FlipsDigital\TextbookListBook\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * TextbookListBook setup factory
     *
     * @var TextbookListBookSetupFactory
     */
    protected $textbooklistbookSetupFactory;

    /**
     * Init
     *
     * @param TextbookListBookSetupFactory $textbooklistbookSetupFactory
     */
    public function __construct(TextbookListBookSetupFactory $textbooklistbookSetupFactory)
    {
        $this->textbooklistbookSetupFactory = $textbooklistbookSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) //@codingStandardsIgnoreLine
    {
        /** @var TextbookListBookSetup $textbooklistbookSetup */
        $textbooklistbookSetup = $this->textbooklistbookSetupFactory->create(['setup' => $setup]);

        $setup->startSetup();

        $textbooklistbookSetup->installEntities();
        $entities = $textbooklistbookSetup->getDefaultEntities();
        foreach ($entities as $entityName => $entity) {
            $textbooklistbookSetup->addEntityType($entityName, $entity);
        }

        $setup->endSetup();
    }
}