@@ -155,7 +155,7 @@ There are five steps in developing a data patch. All the steps below are written
155
155
```php
156
156
// Get the newly created attribute's model
157
157
$attribute = $this->customerSetup->getEavConfig()
158
- ->getAttribute(CustomerMetadataInterface::ENTITY , 'externalcorp_external_id');
158
+ ->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER , 'externalcorp_external_id');
159
159
160
160
// Make attribute visible in Admin customer form
161
161
$attribute->setData('used_in_forms', [
@@ -214,7 +214,6 @@ namespace ExampleCorp\Customer\Setup\Patch\Data;
214
214
use Exception;
215
215
use Psr\Log\LoggerInterface;
216
216
use Magento\Customer\Api\CustomerMetadataInterface;
217
- use Magento\Customer\Model\Customer;
218
217
use Magento\Customer\Model\ResourceModel\Attribute as AttributeResource;
219
218
use Magento\Customer\Setup\CustomerSetup;
220
219
use Magento\Customer\Setup\CustomerSetupFactory;
@@ -329,7 +328,7 @@ class ExternalId implements DataPatchInterface
329
328
330
329
// Get the newly created attribute's model
331
330
$attribute = $this->customerSetup->getEavConfig()
332
- ->getAttribute(Customer::ENTITY , 'externalcorp_external_id');
331
+ ->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER , 'externalcorp_external_id');
333
332
334
333
// Make attribute visible in Admin customer form
335
334
$attribute->setData('used_in_forms', [
0 commit comments