コード例 #1
0
ファイル: Share.php プロジェクト: nja78/magento2
 /**
  * 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;
 }
コード例 #2
0
ファイル: Share.php プロジェクト: kid17/magento2
 /**
  * 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;
 }