/** * Check for email duplicates before saving customers sharing options * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function beforeSave() { $value = $this->getValue(); if ($value == self::SHARE_GLOBAL) { if ($this->_customerResource->findEmailDuplicates()) { //@codingStandardsIgnoreStart throw new \Magento\Framework\Exception\LocalizedException(__('We can\'t share customer accounts globally when the accounts share identical email addresses on more than one website.')); //@codingStandardsIgnoreEnd } } return $this; }
/** * Check for email duplicates before saving customers sharing options * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ public function beforeSave() { $value = $this->getValue(); if ($value == self::SHARE_GLOBAL) { if ($this->_customerResource->findEmailDuplicates()) { //@codingStandardsIgnoreStart throw new \Magento\Framework\Exception\LocalizedException(__('Cannot share customer accounts globally because some customer accounts with the same emails exist on multiple websites and cannot be merged.')); //@codingStandardsIgnoreEnd } } return $this; }