Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit df94bff

Browse files
authored
Merge pull request #9303 from #9303
[Imported] Remove Unused dependency and wrong Constant
2 parents 29ff657 + 3a9149d commit df94bff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/guides/v2.3/howdoi/custom-attributes/text-field.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ There are five steps in developing a data patch. All the steps below are written
155155
```php
156156
// Get the newly created attribute's model
157157
$attribute = $this->customerSetup->getEavConfig()
158-
->getAttribute(CustomerMetadataInterface::ENTITY, 'externalcorp_external_id');
158+
->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, 'externalcorp_external_id');
159159

160160
// Make attribute visible in Admin customer form
161161
$attribute->setData('used_in_forms', [
@@ -214,7 +214,6 @@ namespace ExampleCorp\Customer\Setup\Patch\Data;
214214
use Exception;
215215
use Psr\Log\LoggerInterface;
216216
use Magento\Customer\Api\CustomerMetadataInterface;
217-
use Magento\Customer\Model\Customer;
218217
use Magento\Customer\Model\ResourceModel\Attribute as AttributeResource;
219218
use Magento\Customer\Setup\CustomerSetup;
220219
use Magento\Customer\Setup\CustomerSetupFactory;
@@ -329,7 +328,7 @@ class ExternalId implements DataPatchInterface
329328

330329
// Get the newly created attribute's model
331330
$attribute = $this->customerSetup->getEavConfig()
332-
->getAttribute(Customer::ENTITY, 'externalcorp_external_id');
331+
->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, 'externalcorp_external_id');
333332

334333
// Make attribute visible in Admin customer form
335334
$attribute->setData('used_in_forms', [

0 commit comments

Comments
 (0)