Your IP : 216.73.216.220


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

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

namespace FlipsDigital\TextbookListStudent\Setup;

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

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * TextbookListStudent setup factory
     *
     * @var TextbookListStudentSetupFactory
     */
    protected $textbookliststudentSetupFactory;

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

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

        $setup->startSetup();

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

        $setup->endSetup();
    }
}