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_Catalog_Model_Entity_Product_Attribute_Design_Options_Container
  • Mage_Catalog_Model_Product_Attribute_Source_Inputtype
  • Mage_Eav_Block_Adminhtml_Attribute_Edit_Js
  • Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
  • Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
  • Mage_Eav_Helper_Data
  • Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype
  • Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype_Validator
  • Mage_Eav_Model_Attribute
  • Mage_Eav_Model_Attribute_Data
  • Mage_Eav_Model_Attribute_Data_Abstract
  • Mage_Eav_Model_Attribute_Data_Boolean
  • Mage_Eav_Model_Attribute_Data_Date
  • Mage_Eav_Model_Attribute_Data_File
  • Mage_Eav_Model_Attribute_Data_Hidden
  • Mage_Eav_Model_Attribute_Data_Image
  • Mage_Eav_Model_Attribute_Data_Multiline
  • Mage_Eav_Model_Attribute_Data_Multiselect
  • Mage_Eav_Model_Attribute_Data_Select
  • Mage_Eav_Model_Attribute_Data_Text
  • Mage_Eav_Model_Attribute_Data_Textarea
  • Mage_Eav_Model_Config
  • Mage_Eav_Model_Convert_Adapter_Entity
  • Mage_Eav_Model_Convert_Adapter_Grid
  • Mage_Eav_Model_Convert_Parser_Abstract
  • Mage_Eav_Model_Entity
  • Mage_Eav_Model_Entity_Abstract
  • Mage_Eav_Model_Entity_Attribute
  • Mage_Eav_Model_Entity_Attribute_Abstract
  • Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  • Mage_Eav_Model_Entity_Attribute_Backend_Array
  • Mage_Eav_Model_Entity_Attribute_Backend_Datetime
  • Mage_Eav_Model_Entity_Attribute_Backend_Default
  • Mage_Eav_Model_Entity_Attribute_Backend_Increment
  • Mage_Eav_Model_Entity_Attribute_Backend_Serialized
  • Mage_Eav_Model_Entity_Attribute_Backend_Store
  • Mage_Eav_Model_Entity_Attribute_Backend_Time_Created
  • Mage_Eav_Model_Entity_Attribute_Backend_Time_Updated
  • Mage_Eav_Model_Entity_Attribute_Frontend_Abstract
  • Mage_Eav_Model_Entity_Attribute_Frontend_Datetime
  • Mage_Eav_Model_Entity_Attribute_Frontend_Default
  • Mage_Eav_Model_Entity_Attribute_Group
  • Mage_Eav_Model_Entity_Attribute_Option
  • Mage_Eav_Model_Entity_Attribute_Set
  • Mage_Eav_Model_Entity_Attribute_Source_Abstract
  • Mage_Eav_Model_Entity_Attribute_Source_Boolean
  • Mage_Eav_Model_Entity_Attribute_Source_Config
  • Mage_Eav_Model_Entity_Attribute_Source_Store
  • Mage_Eav_Model_Entity_Attribute_Source_Table
  • Mage_Eav_Model_Entity_Collection
  • Mage_Eav_Model_Entity_Collection_Abstract
  • Mage_Eav_Model_Entity_Increment_Abstract
  • Mage_Eav_Model_Entity_Increment_Alphanum
  • Mage_Eav_Model_Entity_Increment_Numeric
  • Mage_Eav_Model_Entity_Setup
  • Mage_Eav_Model_Entity_Store
  • Mage_Eav_Model_Entity_Type
  • Mage_Eav_Model_Form
  • Mage_Eav_Model_Form_Element
  • Mage_Eav_Model_Form_Fieldset
  • Mage_Eav_Model_Form_Type
  • Mage_Eav_Model_Mysql4_Config
  • Mage_Eav_Model_Mysql4_Entity_Attribute
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Collection
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Group
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Group_Collection
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Option
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Option_Collection
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Set
  • Mage_Eav_Model_Mysql4_Entity_Attribute_Set_Collection
  • Mage_Eav_Model_Mysql4_Entity_Store
  • Mage_Eav_Model_Mysql4_Entity_Type
  • Mage_Eav_Model_Mysql4_Entity_Type_Collection
  • Mage_Eav_Model_Mysql4_Form_Element
  • Mage_Eav_Model_Mysql4_Form_Element_Collection
  • Mage_Eav_Model_Mysql4_Form_Fieldset
  • Mage_Eav_Model_Mysql4_Form_Fieldset_Collection
  • Mage_Eav_Model_Mysql4_Form_Type
  • Mage_Eav_Model_Mysql4_Form_Type_Collection
  • Mage_Eav_Model_Resource_Attribute
  • Mage_Eav_Model_Resource_Attribute_Collection
  • Mage_Eav_Model_Resource_Config
  • Mage_Eav_Model_Resource_Entity_Attribute
  • Mage_Eav_Model_Resource_Entity_Attribute_Collection
  • Mage_Eav_Model_Resource_Entity_Attribute_Group
  • Mage_Eav_Model_Resource_Entity_Attribute_Group_Collection
  • Mage_Eav_Model_Resource_Entity_Attribute_Option
  • Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection
  • Mage_Eav_Model_Resource_Entity_Attribute_Set
  • Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection
  • Mage_Eav_Model_Resource_Entity_Store
  • Mage_Eav_Model_Resource_Entity_Type
  • Mage_Eav_Model_Resource_Entity_Type_Collection
  • Mage_Eav_Model_Resource_Form_Attribute
  • Mage_Eav_Model_Resource_Form_Attribute_Collection
  • Mage_Eav_Model_Resource_Form_Element
  • Mage_Eav_Model_Resource_Form_Element_Collection
  • Mage_Eav_Model_Resource_Form_Fieldset
  • Mage_Eav_Model_Resource_Form_Fieldset_Collection
  • Mage_Eav_Model_Resource_Form_Type
  • Mage_Eav_Model_Resource_Form_Type_Collection
  • Mage_Eav_Model_Resource_Helper_Mysql4

Interfaces

  • Mage_Eav_Model_Entity_Attribute_Backend_Interface
  • Mage_Eav_Model_Entity_Attribute_Frontend_Interface
  • Mage_Eav_Model_Entity_Attribute_Interface
  • Mage_Eav_Model_Entity_Attribute_Source_Interface
  • Mage_Eav_Model_Entity_Increment_Interface
  • Mage_Eav_Model_Entity_Interface

Exceptions

  • Mage_Eav_Exception
  • Mage_Eav_Model_Entity_Attribute_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_Eav
 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:  * EAV attribute resource model (Using Forms)
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Eav
 32:  * @author     Magento Core Team <core@magentocommerce.com>
 33:  */
 34: abstract class Mage_Eav_Model_Attribute extends Mage_Eav_Model_Entity_Attribute
 35: {
 36:     /**
 37:      * Name of the module
 38:      * Override it
 39:      */
 40:     //const MODULE_NAME = 'Mage_Eav';
 41: 
 42:     /**
 43:      * Prefix of model events object
 44:      *
 45:      * @var string
 46:      */
 47:     protected $_eventObject = 'attribute';
 48: 
 49:     /**
 50:      * Active Website instance
 51:      *
 52:      * @var Mage_Core_Model_Website
 53:      */
 54:     protected $_website;
 55: 
 56:     /**
 57:      * Set active website instance
 58:      *
 59:      * @param Mage_Core_Model_Website|int $website
 60:      * @return Mage_Eav_Model_Attribute
 61:      */
 62:     public function setWebsite($website)
 63:     {
 64:         $this->_website = Mage::app()->getWebsite($website);
 65:         return $this;
 66:     }
 67: 
 68:     /**
 69:      * Return active website instance
 70:      *
 71:      * @return Mage_Core_Model_Website
 72:      */
 73:     public function getWebsite()
 74:     {
 75:         if (is_null($this->_website)) {
 76:             $this->_website = Mage::app()->getWebsite();
 77:         }
 78: 
 79:         return $this->_website;
 80:     }
 81: 
 82:     /**
 83:      * Processing object after save data
 84:      *
 85:      * @return Mage_Eav_Model_Attribute
 86:      */
 87:     protected function _afterSave()
 88:     {
 89:         Mage::getSingleton('eav/config')->clear();
 90:         return parent::_afterSave();
 91:     }
 92: 
 93:     /**
 94:      * Return forms in which the attribute
 95:      *
 96:      * @return array
 97:      */
 98:     public function getUsedInForms()
 99:     {
100:         $forms = $this->getData('used_in_forms');
101:         if (is_null($forms)) {
102:             $forms = $this->_getResource()->getUsedInForms($this);
103:             $this->setData('used_in_forms', $forms);
104:         }
105:         return $forms;
106:     }
107: 
108:     /**
109:      * Return validate rules
110:      *
111:      * @return array
112:      */
113:     public function getValidateRules()
114:     {
115:         $rules = $this->getData('validate_rules');
116:         if (is_array($rules)) {
117:             return $rules;
118:         } else if (!empty($rules)) {
119:             return unserialize($rules);
120:         }
121:         return array();
122:     }
123: 
124:     /**
125:      * Set validate rules
126:      *
127:      * @param array|string $rules
128:      * @return Mage_Eav_Model_Attribute
129:      */
130:     public function setValidateRules($rules)
131:     {
132:         if (empty($rules)) {
133:             $rules = null;
134:         } else if (is_array($rules)) {
135:             $rules = serialize($rules);
136:         }
137:         $this->setData('validate_rules', $rules);
138: 
139:         return $this;
140:     }
141: 
142:     /**
143:      * Return scope value by key
144:      *
145:      * @param string $key
146:      * @return mixed
147:      */
148:     protected function _getScopeValue($key)
149:     {
150:         $scopeKey = sprintf('scope_%s', $key);
151:         if ($this->getData($scopeKey) !== null) {
152:             return $this->getData($scopeKey);
153:         }
154:         return $this->getData($key);
155:     }
156: 
157:     /**
158:      * Return is attribute value required
159:      *
160:      * @return mixed
161:      */
162:     public function getIsRequired()
163:     {
164:         return $this->_getScopeValue('is_required');
165:     }
166: 
167:     /**
168:      * Return is visible attribute flag
169:      *
170:      * @return mixed
171:      */
172:     public function getIsVisible()
173:     {
174:         return $this->_getScopeValue('is_visible');
175:     }
176: 
177:     /**
178:      * Return default value for attribute
179:      *
180:      * @return mixed
181:      */
182:     public function getDefaultValue()
183:     {
184:         return $this->_getScopeValue('default_value');
185:     }
186: 
187:     /**
188:      * Return count of lines for multiply line attribute
189:      *
190:      * @return mixed
191:      */
192:     public function getMultilineCount()
193:     {
194:         return $this->_getScopeValue('multiline_count');
195:     }
196: }
197: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0