Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddCustomerUpdatedAtAttribute.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Setup\CustomerSetupFactory;
15 
21 {
25  private $moduleDataSetup;
26 
30  private $customerSetupFactory;
31 
37  public function __construct(
38  ModuleDataSetupInterface $moduleDataSetup,
39  CustomerSetupFactory $customerSetupFactory
40  ) {
41  $this->moduleDataSetup = $moduleDataSetup;
42  $this->customerSetupFactory = $customerSetupFactory;
43  }
44 
48  public function apply()
49  {
50  $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);
51  $customerSetup->addAttribute(
53  'updated_at',
54  [
55  'type' => 'static',
56  'label' => 'Updated At',
57  'input' => 'date',
58  'required' => false,
59  'sort_order' => 87,
60  'visible' => false,
61  'system' => false,
62  ]
63  );
64  }
65 
69  public static function getDependencies()
70  {
71  return [
72  UpdateIdentifierCustomerAttributesVisibility::class,
73  ];
74  }
75 
79  public static function getVersion()
80  {
81  return '2.0.4';
82  }
83 
87  public function getAliases()
88  {
89  return [];
90  }
91 }
__construct(ModuleDataSetupInterface $moduleDataSetup, CustomerSetupFactory $customerSetupFactory)