Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Customer_AccountController
  • Mage_Customer_AddressController
  • Mage_Customer_Block_Account
  • Mage_Customer_Block_Account_Dashboard
  • Mage_Customer_Block_Account_Dashboard_Address
  • Mage_Customer_Block_Account_Dashboard_Block
  • Mage_Customer_Block_Account_Dashboard_Hello
  • Mage_Customer_Block_Account_Dashboard_Info
  • Mage_Customer_Block_Account_Dashboard_Newsletter
  • Mage_Customer_Block_Account_Dashboard_Sidebar
  • Mage_Customer_Block_Account_Forgotpassword
  • Mage_Customer_Block_Account_Navigation
  • Mage_Customer_Block_Account_Resetpassword
  • Mage_Customer_Block_Address_Book
  • Mage_Customer_Block_Address_Edit
  • Mage_Customer_Block_Address_Renderer_Default
  • Mage_Customer_Block_Form_Edit
  • Mage_Customer_Block_Form_Login
  • Mage_Customer_Block_Form_Register
  • Mage_Customer_Block_Newsletter
  • Mage_Customer_Block_Widget_Abstract
  • Mage_Customer_Block_Widget_Dob
  • Mage_Customer_Block_Widget_Gender
  • Mage_Customer_Block_Widget_Name
  • Mage_Customer_Block_Widget_Taxvat
  • Mage_Customer_Helper_Address
  • Mage_Customer_Helper_Data
  • Mage_Customer_Model_Address
  • Mage_Customer_Model_Address_Abstract
  • Mage_Customer_Model_Address_Api
  • Mage_Customer_Model_Address_Api_V2
  • Mage_Customer_Model_Address_Config
  • Mage_Customer_Model_Api2_Customer
  • Mage_Customer_Model_Api2_Customer_Address
  • Mage_Customer_Model_Api2_Customer_Address_Rest
  • Mage_Customer_Model_Api2_Customer_Address_Rest_Admin_V1
  • Mage_Customer_Model_Api2_Customer_Address_Rest_Customer_V1
  • Mage_Customer_Model_Api2_Customer_Address_Validator
  • Mage_Customer_Model_Api2_Customer_Rest
  • Mage_Customer_Model_Api2_Customer_Rest_Admin_V1
  • Mage_Customer_Model_Api2_Customer_Rest_Customer_V1
  • Mage_Customer_Model_Api_Resource
  • Mage_Customer_Model_Attribute
  • Mage_Customer_Model_Attribute_Backend_Data_Boolean
  • Mage_Customer_Model_Attribute_Data
  • Mage_Customer_Model_Attribute_Data_Abstract
  • Mage_Customer_Model_Attribute_Data_Boolean
  • Mage_Customer_Model_Attribute_Data_Date
  • Mage_Customer_Model_Attribute_Data_File
  • Mage_Customer_Model_Attribute_Data_Hidden
  • Mage_Customer_Model_Attribute_Data_Image
  • Mage_Customer_Model_Attribute_Data_Multiline
  • Mage_Customer_Model_Attribute_Data_Multiselect
  • Mage_Customer_Model_Attribute_Data_Postcode
  • Mage_Customer_Model_Attribute_Data_Select
  • Mage_Customer_Model_Attribute_Data_Text
  • Mage_Customer_Model_Attribute_Data_Textarea
  • Mage_Customer_Model_Config_Share
  • Mage_Customer_Model_Convert_Adapter_Customer
  • Mage_Customer_Model_Convert_Parser_Customer
  • Mage_Customer_Model_Customer
  • Mage_Customer_Model_Customer_Api
  • Mage_Customer_Model_Customer_Api_V2
  • Mage_Customer_Model_Customer_Attribute_Backend_Billing
  • Mage_Customer_Model_Customer_Attribute_Backend_Password
  • Mage_Customer_Model_Customer_Attribute_Backend_Shipping
  • Mage_Customer_Model_Customer_Attribute_Backend_Store
  • Mage_Customer_Model_Customer_Attribute_Backend_Website
  • Mage_Customer_Model_Customer_Attribute_Source_Group
  • Mage_Customer_Model_Customer_Attribute_Source_Store
  • Mage_Customer_Model_Customer_Attribute_Source_Website
  • Mage_Customer_Model_Entity_Address
  • Mage_Customer_Model_Entity_Address_Attribute_Backend_Region
  • Mage_Customer_Model_Entity_Address_Attribute_Backend_Street
  • Mage_Customer_Model_Entity_Address_Attribute_Collection
  • Mage_Customer_Model_Entity_Address_Attribute_Source_Country
  • Mage_Customer_Model_Entity_Address_Attribute_Source_Region
  • Mage_Customer_Model_Entity_Address_Collection
  • Mage_Customer_Model_Entity_Attribute
  • Mage_Customer_Model_Entity_Attribute_Collection
  • Mage_Customer_Model_Entity_Customer
  • Mage_Customer_Model_Entity_Customer_Collection
  • Mage_Customer_Model_Entity_Form_Attribute
  • Mage_Customer_Model_Entity_Form_Attribute_Collection
  • Mage_Customer_Model_Entity_Group
  • Mage_Customer_Model_Entity_Group_Collection
  • Mage_Customer_Model_Entity_Setup
  • Mage_Customer_Model_Entity_Wishlist_Collection
  • Mage_Customer_Model_Form
  • Mage_Customer_Model_Group
  • Mage_Customer_Model_Group_Api
  • Mage_Customer_Model_Group_Api_V2
  • Mage_Customer_Model_Observer
  • Mage_Customer_Model_Resource_Address
  • Mage_Customer_Model_Resource_Address_Attribute_Backend_Region
  • Mage_Customer_Model_Resource_Address_Attribute_Backend_Street
  • Mage_Customer_Model_Resource_Address_Attribute_Collection
  • Mage_Customer_Model_Resource_Address_Attribute_Source_Country
  • Mage_Customer_Model_Resource_Address_Attribute_Source_Region
  • Mage_Customer_Model_Resource_Address_Collection
  • Mage_Customer_Model_Resource_Attribute
  • Mage_Customer_Model_Resource_Attribute_Collection
  • Mage_Customer_Model_Resource_Customer
  • Mage_Customer_Model_Resource_Customer_Collection
  • Mage_Customer_Model_Resource_Form_Attribute
  • Mage_Customer_Model_Resource_Form_Attribute_Collection
  • Mage_Customer_Model_Resource_Group
  • Mage_Customer_Model_Resource_Group_Collection
  • Mage_Customer_Model_Resource_Setup
  • Mage_Customer_Model_Resource_Wishlist_Collection
  • Mage_Customer_Model_Session
  • Mage_Customer_ReviewController

Interfaces

  • Mage_Customer_Block_Address_Renderer_Interface

Exceptions

  • Mage_Customer_Exception
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Customer
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Customer group model
 29:  *
 30:  * @method Mage_Customer_Model_Resource_Group _getResource()
 31:  * @method Mage_Customer_Model_Resource_Group getResource()
 32:  * @method string getCustomerGroupCode()
 33:  * @method Mage_Customer_Model_Group setCustomerGroupCode(string $value)
 34:  * @method Mage_Customer_Model_Group setTaxClassId(int $value)
 35:  *
 36:  * @category    Mage
 37:  * @package     Mage_Customer
 38:  * @author      Magento Core Team <core@magentocommerce.com>
 39:  */
 40: class Mage_Customer_Model_Group extends Mage_Core_Model_Abstract
 41: {
 42:     /**
 43:      * Xml config path for create account default group
 44:      */
 45:     const XML_PATH_DEFAULT_ID       = 'customer/create_account/default_group';
 46: 
 47:     const NOT_LOGGED_IN_ID          = 0;
 48:     const CUST_GROUP_ALL            = 32000;
 49: 
 50:     const ENTITY                    = 'customer_group';
 51: 
 52:     const GROUP_CODE_MAX_LENGTH     = 32;
 53: 
 54:     /**
 55:      * Prefix of model events names
 56:      *
 57:      * @var string
 58:      */
 59:     protected $_eventPrefix = 'customer_group';
 60: 
 61:     /**
 62:      * Parameter name in event
 63:      *
 64:      * In observe method you can use $observer->getEvent()->getObject() in this case
 65:      *
 66:      * @var string
 67:      */
 68:     protected $_eventObject = 'object';
 69: 
 70:     protected static $_taxClassIds = array();
 71: 
 72:     protected function _construct()
 73:     {
 74:         $this->_init('customer/group');
 75:     }
 76: 
 77:     /**
 78:      * Alias for setCustomerGroupCode
 79:      *
 80:      * @param string $value
 81:      */
 82:     public function setCode($value)
 83:     {
 84:         return $this->setCustomerGroupCode($value);
 85:     }
 86: 
 87:     /**
 88:      * Alias for getCustomerGroupCode
 89:      *
 90:      * @return string
 91:      */
 92:     public function getCode()
 93:     {
 94:         return $this->getCustomerGroupCode();
 95:     }
 96: 
 97:     public function getTaxClassId($groupId = null)
 98:     {
 99:         if (!is_null($groupId)) {
100:             if (empty(self::$_taxClassIds[$groupId])) {
101:                 $this->load($groupId);
102:                 self::$_taxClassIds[$groupId] = $this->getData('tax_class_id');
103:             }
104:             $this->setData('tax_class_id', self::$_taxClassIds[$groupId]);
105:         }
106:         return $this->getData('tax_class_id');
107:     }
108: 
109: 
110:     public function usesAsDefault()
111:     {
112:         $data = Mage::getConfig()->getStoresConfigByPath(self::XML_PATH_DEFAULT_ID);
113:         if (in_array($this->getId(), $data)) {
114:             return true;
115:         }
116:         return false;
117:     }
118: 
119:     /**
120:      * Processing data save after transaction commit
121:      *
122:      * @return Mage_Customer_Model_Group
123:      */
124:     public function afterCommitCallback()
125:     {
126:         parent::afterCommitCallback();
127:         Mage::getSingleton('index/indexer')->processEntityAction(
128:             $this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE
129:         );
130:         return $this;
131:     }
132: 
133:     /**
134:      * Prepare data before save
135:      *
136:      * @return Mage_Core_Model_Abstract
137:      */
138:     protected function _beforeSave()
139:     {
140:         $this->_prepareData();
141:         return parent::_beforeSave();
142:     }
143: 
144:     /**
145:      * Prepare customer group data
146:      *
147:      * @return Mage_Customer_Model_Group
148:      */
149:     protected function _prepareData()
150:     {
151:         $this->setCode(
152:             substr($this->getCode(), 0, self::GROUP_CODE_MAX_LENGTH)
153:         );
154:         return $this;
155:     }
156: 
157: }
158: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0