Public Member Functions | |
isGlobalScope () | |
isWebsiteScope () | |
toOptionArray () | |
_beforeSave () | |
Public Attributes | |
const | XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope' |
const | SHARE_GLOBAL = 0 |
const | SHARE_WEBSITE = 1 |
Definition at line 34 of file Share.php.
_beforeSave | ( | ) |
Check for email dublicates before saving customers sharing options
Mage_Core_Exception |
Reimplemented from Mage_Core_Model_Abstract.
Definition at line 88 of file Share.php.
00089 { 00090 $value = $this->getValue(); 00091 if ($value == self::SHARE_GLOBAL) { 00092 if (Mage::getResourceSingleton('customer/customer')->findEmailDuplicates()) { 00093 Mage::throwException( 00094 Mage::helper('customer')->__('Can\'t share customer accounts global. Because some customer accounts with same emails exist on multiple websites and cannot be merged.') 00095 ); 00096 } 00097 } 00098 return $this; 00099 }
isGlobalScope | ( | ) |
Check whether current customers sharing scope is global
Definition at line 54 of file Share.php.
00055 { 00056 return !$this->isWebsiteScope(); 00057 }
isWebsiteScope | ( | ) |
Check whether current customers sharing scope is website
Definition at line 64 of file Share.php.
00065 { 00066 return Mage::getStoreConfig(self::XML_PATH_CUSTOMER_ACCOUNT_SHARE) == self::SHARE_WEBSITE; 00067 }
toOptionArray | ( | ) |
Get possible sharing configuration options
Definition at line 74 of file Share.php.
00075 { 00076 return array( 00077 self::SHARE_GLOBAL => Mage::helper('customer')->__('Global'), 00078 self::SHARE_WEBSITE => Mage::helper('customer')->__('Per Website'), 00079 ); 00080 }
const SHARE_GLOBAL = 0 |
const SHARE_WEBSITE = 1 |
const XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope' |