moduleDataSetup = $moduleDataSetup; $this->customerSetupFactory = $customerSetupFactory; $this->attributeSetFactory = $attributeSetFactory; } /** * {@inheritdoc} */ public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var CustomerSetup $customerSetup */ $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]); $entityAttributes = [ 'customer_address' => [ 'lastname' => [ 'is_visible' => false, 'is_required' => false, 'is_system' => false, 'is_user_defined' => true ], 'street' => [ 'sort_order' => 355, 'position' => 355, ], 'postcode' => [ 'is_visible' => false, 'is_required' => false ], 'company' => [ 'is_visible' => false ], 'telephone' => [ 'sort_order' => 79, 'validate_rules' => '{"max_text_length":11,"min_text_length":1}', 'position' => 79, ], 'city' => [ 'backend_model' => \Stemcell\ChineseDirectory\Model\Entity\Attribute\Backend\City::class ] ], ]; $customerSetup->upgradeAttributes($entityAttributes); $this->moduleDataSetup->getConnection()->endSetup(); } public function revert() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var CustomerSetup $customerSetup */ $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]); $customerSetup->updateAttribute(AttributeProvider::ENTITY,'lastname','is_required',1); $customerSetup->updateAttribute(AttributeProvider::ENTITY,'city','backend'); $this->moduleDataSetup->getConnection()->endSetup(); } /** * {@inheritdoc} */ public function getAliases() { return []; } /** * {@inheritdoc} */ public static function getDependencies() { return [ ]; } }