PropertyMapper.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Customer attribute property mapper
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Customer\Model\ResourceModel\Setup;
  9. use Magento\Eav\Model\Entity\Setup\PropertyMapperAbstract;
  10. class PropertyMapper extends PropertyMapperAbstract
  11. {
  12. /**
  13. * Map input attribute properties to storage representation
  14. *
  15. * @param array $input
  16. * @param int $entityTypeId
  17. * @return array
  18. *
  19. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  20. */
  21. public function map(array $input, $entityTypeId)
  22. {
  23. return [
  24. 'is_visible' => $this->_getValue($input, 'visible', 1),
  25. 'is_system' => $this->_getValue($input, 'system', 1),
  26. 'input_filter' => $this->_getValue($input, 'input_filter', null),
  27. 'multiline_count' => $this->_getValue($input, 'multiline_count', 0),
  28. 'validate_rules' => $this->_getValue($input, 'validate_rules', null),
  29. 'data_model' => $this->_getValue($input, 'data', null),
  30. 'sort_order' => $this->_getValue($input, 'position', 0),
  31. 'is_used_in_grid' => $this->_getValue($input, 'is_used_in_grid', 0),
  32. 'is_visible_in_grid' => $this->_getValue($input, 'is_visible_in_grid', 0),
  33. 'is_filterable_in_grid' => $this->_getValue($input, 'is_filterable_in_grid', 0),
  34. 'is_searchable_in_grid' => $this->_getValue($input, 'is_searchable_in_grid', 0),
  35. ];
  36. }
  37. }