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: class Mage_Customer_Block_Widget_Name extends Mage_Customer_Block_Widget_Abstract
 28: {
 29:     public function _construct()
 30:     {
 31:         parent::_construct();
 32: 
 33:         // default template location
 34:         $this->setTemplate('customer/widget/name.phtml');
 35:     }
 36: 
 37:     /**
 38:      * Can show config value
 39:      *
 40:      * @param string $key
 41:      * @return bool
 42:      */
 43:     protected function _showConfig($key)
 44:     {
 45:         return (bool)$this->getConfig($key);
 46:     }
 47: 
 48:     /**
 49:      * Can show prefix
 50:      *
 51:      * @return bool
 52:      */
 53:     public function showPrefix()
 54:     {
 55:         return (bool)$this->_getAttribute('prefix')->getIsVisible();
 56:     }
 57: 
 58:     /**
 59:      * Define if prefix attribute is required
 60:      *
 61:      * @return bool
 62:      */
 63:     public function isPrefixRequired()
 64:     {
 65:         return (bool)$this->_getAttribute('prefix')->getIsRequired();
 66:     }
 67: 
 68:     /**
 69:      * Retrieve name prefix drop-down options
 70:      *
 71:      * @return array|bool
 72:      */
 73:     public function getPrefixOptions()
 74:     {
 75:         $prefixOptions = $this->helper('customer')->getNamePrefixOptions();
 76: 
 77:         if ($this->getObject() && !empty($prefixOptions)) {
 78:             $oldPrefix = $this->escapeHtml(trim($this->getObject()->getPrefix()));
 79:             $prefixOptions[$oldPrefix] = $oldPrefix;
 80:         }
 81:         return $prefixOptions;
 82:     }
 83: 
 84:     /**
 85:      * Define if middle name attribute can be shown
 86:      *
 87:      * @return bool
 88:      */
 89:     public function showMiddlename()
 90:     {
 91:         return (bool)$this->_getAttribute('middlename')->getIsVisible();
 92:     }
 93: 
 94:     /**
 95:      * Define if middlename attribute is required
 96:      *
 97:      * @return bool
 98:      */
 99:     public function isMiddlenameRequired()
100:     {
101:         return (bool)$this->_getAttribute('middlename')->getIsRequired();
102:     }
103: 
104:     /**
105:      * Define if suffix attribute can be shown
106:      *
107:      * @return bool
108:      */
109:     public function showSuffix()
110:     {
111:         return (bool)$this->_getAttribute('suffix')->getIsVisible();
112:     }
113: 
114:     /**
115:      * Define if suffix attribute is required
116:      *
117:      * @return bool
118:      */
119:     public function isSuffixRequired()
120:     {
121:         return (bool)$this->_getAttribute('suffix')->getIsRequired();
122:     }
123: 
124:     /**
125:      * Retrieve name suffix drop-down options
126:      *
127:      * @return array|bool
128:      */
129:     public function getSuffixOptions()
130:     {
131:         $suffixOptions = $this->helper('customer')->getNameSuffixOptions();
132:         if ($this->getObject() && !empty($suffixOptions)) {
133:             $oldSuffix = $this->escapeHtml(trim($this->getObject()->getSuffix()));
134:             $suffixOptions[$oldSuffix] = $oldSuffix;
135:         }
136:         return $suffixOptions;
137:     }
138: 
139:     /**
140:      * Class name getter
141:      *
142:      * @return string
143:      */
144:     public function getClassName()
145:     {
146:         if (!$this->hasData('class_name')) {
147:             $this->setData('class_name', 'customer-name');
148:         }
149:         return $this->getData('class_name');
150:     }
151: 
152:     /**
153:      * Container class name getter
154:      *
155:      * @return string
156:      */
157:     public function getContainerClassName()
158:     {
159:         $class = $this->getClassName();
160:         $class .= $this->showPrefix() ? '-prefix' : '';
161:         $class .= $this->showMiddlename() ? '-middlename' : '';
162:         $class .= $this->showSuffix() ? '-suffix' : '';
163:         return $class;
164:     }
165: 
166:     /**
167:      * Retrieve customer or customer address attribute instance
168:      *
169:      * @param string $attributeCode
170:      * @return Mage_Customer_Model_Attribute|false
171:      */
172:     protected function _getAttribute($attributeCode)
173:     {
174:         if ($this->getForceUseCustomerAttributes() || $this->getObject() instanceof Mage_Customer_Model_Customer) {
175:             return parent::_getAttribute($attributeCode);
176:         }
177: 
178:         $attribute = Mage::getSingleton('eav/config')->getAttribute('customer_address', $attributeCode);
179: 
180:         if ($this->getForceUseCustomerRequiredAttributes() && $attribute && !$attribute->getIsRequired()) {
181:             $customerAttribute = parent::_getAttribute($attributeCode);
182:             if ($customerAttribute && $customerAttribute->getIsRequired()) {
183:                 $attribute = $customerAttribute;
184:             }
185:         }
186: 
187:         return $attribute;
188:     }
189: 
190:     /**
191:      * Retrieve store attribute label
192:      *
193:      * @param string $attributeCode
194:      * @return string
195:      */
196:     public function getStoreLabel($attributeCode)
197:     {
198:         $attribute = $this->_getAttribute($attributeCode);
199:         return $attribute ? $this->__($attribute->getStoreLabel()) : '';
200:     }
201: }
202: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0