Mage_Customer_Model_Config_Share Class Reference

Inheritance diagram for Mage_Customer_Model_Config_Share:

Mage_Core_Model_Config_Data Mage_Core_Model_Abstract Varien_Object

List of all members.

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


Detailed Description

Definition at line 34 of file Share.php.


Member Function Documentation

_beforeSave (  ) 

Check for email dublicates before saving customers sharing options

Returns:
Mage_Customer_Model_Config_Share
Exceptions:
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

Returns:
bool

Definition at line 54 of file Share.php.

00055     {
00056         return !$this->isWebsiteScope();
00057     }

isWebsiteScope (  ) 

Check whether current customers sharing scope is website

Returns:
bool

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

Returns:
array

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     }


Member Data Documentation

const SHARE_GLOBAL = 0

Possible customer sharing scopes

Definition at line 46 of file Share.php.

const SHARE_WEBSITE = 1

Definition at line 47 of file Share.php.

const XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope'

Xml config path to customers sharing scope value

Definition at line 40 of file Share.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:03 2009 for Magento by  doxygen 1.5.8