9 use Magento\Customer\Setup\CustomerSetupFactory;
25 private $moduleDataSetup;
30 private $customerSetupFactory;
39 CustomerSetupFactory $customerSetupFactory
41 $this->moduleDataSetup = $moduleDataSetup;
42 $this->customerSetupFactory = $customerSetupFactory;
52 'customer_address' => [
54 'is_visible' =>
false,
59 $customerSetup = $this->customerSetupFactory->create([
'setup' => $this->moduleDataSetup]);
60 $customerSetup->upgradeAttributes($entityAttributes);
66 private function upgradeHash()
68 $customerEntityTable = $this->moduleDataSetup->getTable(
'customer_entity');
70 $select = $this->moduleDataSetup->getConnection()->select()->from(
72 [
'entity_id',
'password_hash']
77 if (
$customer[
'password_hash'] ===
null) {
83 if (strlen($hash) === 32) {
85 }
elseif (strlen($hash) === 64) {
89 $bind = [
'password_hash' => $newHash];
90 $where = [
'entity_id = ?' => (int)
$customer[
'entity_id']];
91 $this->moduleDataSetup->getConnection()->update($customerEntityTable, $bind, $where);
101 AddCustomerUpdatedAtAttribute::class,
elseif(isset( $params[ 'redirect_parent']))
const HASH_VERSION_SHA256
__construct(ModuleDataSetupInterface $moduleDataSetup, CustomerSetupFactory $customerSetupFactory)