Class Mage_Customer_Model_Customer

Description

Customer model

Located in /Customer/Model/Customer.php (line 32)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Customer_Model_Customer
Class Constant Summary
SUBSCRIBED_NO = 'no'
SUBSCRIBED_YES = 'yes'
XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template'
XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template'
XML_PATH_DEFAULT_EMAIL_DOMAIN = 'customer/create_account/email_domain'
XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity'
XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template'
XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id'
XML_PATH_IS_CONFIRM = 'customer/create_account/confirm'
XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity'
XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template'
Variable Summary
Method Summary
void addError ( $error)
true authenticate (string $login, string $password)
this changePassword (string $newPassword)
string decryptPassword (string $password)
string encryptPassword (string $password)
string generatePassword ([int $length = 6])
array getAddresses ()
array getAttributes ()
void getErrors ()
int getGroupId ()
string getName ()
int getTaxClassId ()
string hashPassword (string $password, [ $salt = null])
uMage_Customer_Model_Customer importFromTextArray ( $row)
boolean isDeleteable ()
bool isInStore (mixed $store)
boolean isReadonly ()
Mage_Customer_Model_Customer loadByEmail (string $customerEmail)
void printError ( $error, [ $line = null])
void resetErrors ()
Mage_Customer_Model_Customer sendNewAccountEmail ([ $type = 'registered'], [ $backUrl = ''], [ $storeId = '0'])
bool validate ()
void validateAddress ( $data, [ $type = 'billing'])
boolean validatePassword (string $password)
void _beforeDelete ()
void _construct ()
int _getWebsiteStoreId ([ $defaultStoreId = null], int|string|null $storeId)
void __clone ()
Variables
array $_addresses = null (line 62)

Customer addresses array

  • deprecated: after 1.4.0.0-rc1
  • access: protected
Mage_Customer_Model_Entity_Address_Collection $_addressesCollection (line 69)

Customer addresses collection

  • access: protected
mixed $_attributes (line 54)
  • access: protected
mixed $_errors = array() (line 53)
  • access: protected
mixed $_eventObject = 'customer' (line 52)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventObject
Parameter name in event
mixed $_eventPrefix = 'customer' (line 51)
  • access: protected

Redefinition of:
Mage_Core_Model_Abstract::$_eventPrefix
Prefix of model events names
boolean $_isDeleteable = true (line 76)

Is model deleteable

  • access: protected
boolean $_isReadonly = false (line 83)

Is model readonly

  • access: protected

Inherited Variables

Inherited from Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::$_cacheTag
Mage_Core_Model_Abstract::$_dataSaveAllowed
Mage_Core_Model_Abstract::$_isObjectNew
Mage_Core_Model_Abstract::$_resource
Mage_Core_Model_Abstract::$_resourceCollectionName
Mage_Core_Model_Abstract::$_resourceName
Methods
addAddress (line 202)

Add address to address collection

  • access: public
addError (line 947)
void addError ( $error)
  • $error
authenticate (line 110)

Authenticate customer

  • throws: Exception
  • access: public
true authenticate (string $login, string $password)
  • string $login
  • string $password
canSkipConfirmation (line 1092)

Check whether confirmation may be skipped when registering using certain email address

  • access: public
bool canSkipConfirmation ()
changePassword (line 167)

Change customer password

  • access: public
this changePassword (string $newPassword)
  • string $newPassword
cleanAllAddresses (line 942)
void cleanAllAddresses ()
decryptPassword (line 370)

Decrypt password

  • access: public
string decryptPassword (string $password)
  • string $password
encryptPassword (line 359)

Encrypt password

  • access: public
string encryptPassword (string $password)
  • string $password
generatePassword (line 333)

Retrieve random password

  • access: public
string generatePassword ([int $length = 6])
  • int $length
getAdditionalAddresses (line 477)

Retrieve not default addresses

  • access: public
array getAdditionalAddresses ()
getAddressById (line 216)

Retrieve customer address by address id

  • access: public
Mage_Customer_Model_Address getAddressById (int $addressId)
  • int $addressId
getAddressCollection (line 238)

Retrieve not loaded address collection

  • access: public
getAddresses (line 267)

Retrieve customer address array

  • access: public
array getAddresses ()
getAddressesCollection (line 248)

Customer addresses collection

  • access: public
getAddressItemById (line 228)

Getting customer address object from collection by identifier

  • access: public
Mage_Customer_Model_Address getAddressItemById (int $addressId)
  • int $addressId
getAttribute (line 294)

Get customer attribute model object

  • return: || null
  • access: public
Mage_Customer_Model_Entity_Attribute getAttribute (string $attributeCode)
  • string $attributeCode
getAttributes (line 278)

Retrieve all customer attributes

  • access: public
array getAttributes ()
getCreatedAtTimestamp (line 1021)

Get customer created at date timestamp

  • access: public
int getCreatedAtTimestamp ()
getDefaultBillingAddress (line 403)

Get customer default billing address

  • access: public
Mage_Customer_Model_Address getDefaultBillingAddress ()
getDefaultShippingAddress (line 423)

Get default customer shipping address

  • access: public
Mage_Customer_Model_Address getDefaultShippingAddress ()
getEntityType (line 1114)

Return Entity Type instance

  • access: public
Mage_Eav_Model_Entity_Type getEntityType ()
getEntityTypeId (line 1124)

Return Entity Type ID

  • access: public
int getEntityTypeId ()
getErrors (line 952)
void getErrors ()
getGroupId (line 592)

Retrieve customer group identifier

  • access: public
int getGroupId ()
getName (line 178)

Get full customer name

  • access: public
string getName ()
getPrimaryAddress (line 381)

Retrieve default address by type(attribute)

  • access: public
Mage_Customer_Model_Address getPrimaryAddress (string $attributeCode)
  • string $attributeCode: address type attribute code
getPrimaryAddresses (line 450)

Retrieve all customer default addresses

  • access: public
array getPrimaryAddresses ()
getPrimaryAddressIds (line 433)

Retrieve ids of default addresses

  • access: public
unknown getPrimaryAddressIds ()
getPrimaryBillingAddress (line 393)

Get customer default billing address

  • access: public
Mage_Customer_Model_Address getPrimaryBillingAddress ()
getPrimaryShippingAddress (line 413)

Get default customer shipping address

  • access: public
Mage_Customer_Model_Address getPrimaryShippingAddress ()
getRandomConfirmationKey (line 551)
  • access: public
void getRandomConfirmationKey ()
getSharedStoreIds (line 648)

Retrieve shared store ids

  • access: public
array getSharedStoreIds ()
getSharedWebsiteIds (line 671)

Retrive shared website ids

  • access: public
array getSharedWebsiteIds ()
getSharingConfig (line 97)

Retrieve customer sharing configuration model

  • access: public
Mage_Customer_Model_Config_Share getSharingConfig ()
getStore (line 638)

Retrieve store where customer was created

  • access: public
Mage_Core_Model_Store getStore ()
getTaxClassId (line 606)

Retrieve customer tax class identifier

  • access: public
int getTaxClassId ()
hashPassword (line 322)

Hash customer password

  • access: public
string hashPassword (string $password, [ $salt = null])
  • string $password
  • $salt
importFromTextArray (line 762)

Importing customer data from text array

  • access: public
uMage_Customer_Model_Customer importFromTextArray ( $row)
  • array $row
isAddressPrimary (line 489)
  • access: public
void isAddressPrimary (Mage_Customer_Model_Address $address)
isConfirmationRequired (line 540)

Check if accounts confirmation is required in config

  • access: public
bool isConfirmationRequired ()
isDeleteable (line 1048)

Checks model is deleteable

  • access: public
boolean isDeleteable ()
isInStore (line 620)

Check store availability for customer

  • access: public
bool isInStore (mixed $store)
  • mixed $store
isReadonly (line 1070)

Checks model is readonly

  • access: public
boolean isReadonly ()
loadByEmail (line 136)

Load customer by email

  • access: public
Mage_Customer_Model_Customer loadByEmail (string $customerEmail)
  • string $customerEmail
printError (line 962)
void printError ( $error, [ $line = null])
  • $error
  • $line
reset (line 1034)

Reset all model data

  • access: public
resetErrors (line 957)
void resetErrors ()
sendNewAccountEmail (line 502)

Send email with new account specific information

  • access: public
Mage_Customer_Model_Customer sendNewAccountEmail ([ $type = 'registered'], [ $backUrl = ''], [ $storeId = '0'])
  • $type
  • $backUrl
  • $storeId
sendPasswordReminderEmail (line 561)

Send email with new customer password

  • access: public
Mage_Customer_Model_Customer sendPasswordReminderEmail ()
setIsDeleteable (line 1059)

Set is deleteable flag

  • access: public
Mage_Customer_Model_Customer setIsDeleteable (boolean $value)
  • boolean $value
setIsReadonly (line 1081)

Set is readonly flag

  • access: public
Mage_Customer_Model_Customer setIsReadonly (boolean $value)
  • boolean $value
setPassword (line 309)

Set plain and hashed password

  • access: public
Mage_Customer_Model_Customer setPassword (string $password)
  • string $password
setStore (line 695)

Enter description here...

  • access: public
Mage_Customer_Model_Customer setStore ( $store)
unsetSubscription (line 935)
void unsetSubscription ()
validate (line 708)

Validate customer attribute values.

For existing customer password + confirmation will be validated only when password is set (i.e. its change is requested)

  • access: public
bool validate ()
validateAddress (line 976)
void validateAddress ( $data, [ $type = 'billing'])
  • array $data
  • $type
validatePassword (line 344)

Validate password with salted hash

  • access: public
boolean validatePassword (string $password)
  • string $password
_beforeDelete (line 1010)
  • access: protected
void _beforeDelete ()

Redefinition of:
Mage_Core_Model_Abstract::_beforeDelete()
Processing object before delete data
_beforeSave (line 148)

Processing object before save data

  • access: protected
Mage_Core_Model_Abstract _beforeSave ()

Redefinition of:
Mage_Core_Model_Abstract::_beforeSave()
Processing object before save data
_construct (line 87)
void _construct ()
_getWebsiteStoreId (line 1141)

Get either first store ID from a set website or the provided as default

  • access: protected
int _getWebsiteStoreId ([ $defaultStoreId = null], int|string|null $storeId)
  • int|string|null $storeId
  • $defaultStoreId
__clone (line 1098)
  • access: public
void __clone ()

Inherited Methods

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
EXCEPTION_EMAIL_EXISTS = 3 (line 46)
EXCEPTION_EMAIL_NOT_CONFIRMED = 1 (line 44)
EXCEPTION_INVALID_EMAIL_OR_PASSWORD = 2 (line 45)
SUBSCRIBED_NO = 'no' (line 49)
SUBSCRIBED_YES = 'yes' (line 48)
XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template' (line 41)
XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template' (line 40)
XML_PATH_DEFAULT_EMAIL_DOMAIN = 'customer/create_account/email_domain' (line 38)
XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity' (line 37)
XML_PATH_FORGOT_EMAIL_TEMPLATE = 'customer/password/forgot_email_template' (line 36)
XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id' (line 42)
XML_PATH_IS_CONFIRM = 'customer/create_account/confirm' (line 39)
XML_PATH_REGISTER_EMAIL_IDENTITY = 'customer/create_account/email_identity' (line 35)
XML_PATH_REGISTER_EMAIL_TEMPLATE = 'customer/create_account/email_template' (line 34)

Documentation generated on Fri, 11 Feb 2011 17:00:16 +0200 by phpDocumentor 1.4.3