45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Pfay\Contacts\Setup;
|
|
|
|
use Magento\Eav\Setup\EavSetupFactory;
|
|
use Magento\Framework\Setup\InstallDataInterface;
|
|
use Magento\Framework\Setup\ModuleContextInterface;
|
|
use Magento\Framework\Setup\ModuleDataSetupInterface;
|
|
|
|
class InstallData implements InstallDataInterface
|
|
{
|
|
|
|
private $eavSetupFactory;
|
|
|
|
public function __construct(EavSetupFactory $eavSetupFactory)
|
|
{
|
|
$this->eavSetupFactory = $eavSetupFactory;
|
|
}
|
|
|
|
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
|
|
{
|
|
$setup->startSetup();
|
|
|
|
$eavSetup = $this->eavSetupFactory->create(array('setup' => $setup));
|
|
|
|
$eavSetup->addAttribute(
|
|
'pfay_contacts',
|
|
array(
|
|
'type'=>'varchar',
|
|
'input'=>'text',
|
|
'label'=>'Inchoo Custom',
|
|
'required'=>false,
|
|
'user_defined'=>true,
|
|
'global'=>\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
|
|
'group'=>'Pfay Contacts'
|
|
)
|
|
);
|
|
|
|
$setup->endSetup();
|
|
|
|
}
|
|
|
|
|
|
}
|