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/UpgradeData.php

<?php

namespace FlipsDigital\TextbookListStudent\Setup;

use Magento\Framework\Setup\UpgradeDataInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface;

class UpgradeData implements UpgradeDataInterface
{
	protected $TextbookliststudentSetupFactory;

	public function __construct(
        TextbookListStudentSetupFactory $TextbookliststudentSetupFactory,
        \FlipsDigital\TextbookListStudent\Model\TextbookListStudentFactory $TextbookListStudentFactory
    )
    {
        $this->_textbookliststudentSetupFactory = $TextbookliststudentSetupFactory;
        // $this->_tlsFactory = $TextbookListStudentFactory;
    }

	public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
	{
		$setup->startSetup();
        $eavSetup = $this->_textbookliststudentSetupFactory->create(['setup' => $setup]);

        if (version_compare($context->getVersion(), '0.0.2', '<')) {
            $eavSetup->addAttribute(
                \FlipsDigital\TextbookListStudent\Model\TextbookListStudent::ENTITY,
                'mers_stock_source_g_gl_student_name',
                [
                    'type' => 'varchar',
                    'label' => 'MersStock - Source [G_GL_STUDENT].[STUDENT_NAME]',
                    'input' => 'text',
                    'sort_order' => 100,
                    'global' => ScopedAttributeInterface::SCOPE_STORE,
                    'group' => 'General',
                ]
            );
        }

        $setup->endSetup();
	}
}