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: /**
 29:  * Eav Form Type Model
 30:  *
 31:  * @method Mage_Eav_Model_Resource_Form_Type _getResource()
 32:  * @method Mage_Eav_Model_Resource_Form_Type getResource()
 33:  * @method string getCode()
 34:  * @method Mage_Eav_Model_Form_Type setCode(string $value)
 35:  * @method string getLabel()
 36:  * @method Mage_Eav_Model_Form_Type setLabel(string $value)
 37:  * @method int getIsSystem()
 38:  * @method Mage_Eav_Model_Form_Type setIsSystem(int $value)
 39:  * @method string getTheme()
 40:  * @method Mage_Eav_Model_Form_Type setTheme(string $value)
 41:  * @method int getStoreId()
 42:  * @method Mage_Eav_Model_Form_Type setStoreId(int $value)
 43:  *
 44:  * @category    Mage
 45:  * @package     Mage_Eav
 46:  * @author      Magento Core Team <core@magentocommerce.com>
 47:  */
 48: class Mage_Eav_Model_Form_Type extends Mage_Core_Model_Abstract
 49: {
 50:     /**
 51:      * Prefix of model events names
 52:      *
 53:      * @var string
 54:      */
 55:     protected $_eventPrefix = 'eav_form_type';
 56: 
 57:     /**
 58:      * Initialize resource model
 59:      *
 60:      */
 61:     protected function _construct()
 62:     {
 63:         $this->_init('eav/form_type');
 64:     }
 65: 
 66:     /**
 67:      * Retrieve resource instance wrapper
 68:      *
 69:      * @return Mage_Eav_Model_Mysql4_Form_Type
 70:      */
 71:     protected function _getResource()
 72:     {
 73:         return parent::_getResource();
 74:     }
 75: 
 76:     /**
 77:      * Retrieve resource collection instance wrapper
 78:      *
 79:      * @return Mage_Eav_Model_Mysql4_Form_Type_Collection
 80:      */
 81:     public function getCollection()
 82:     {
 83:         return parent::getCollection();
 84:     }
 85: 
 86:     /**
 87:      * Retrieve assigned Eav Entity types
 88:      *
 89:      * @return array
 90:      */
 91:     public function getEntityTypes()
 92:     {
 93:         if (!$this->hasData('entity_types')) {
 94:             $this->setData('entity_types', $this->_getResource()->getEntityTypes($this));
 95:         }
 96:         return $this->_getData('entity_types');
 97:     }
 98: 
 99:     /**
100:      * Set assigned Eav Entity types
101:      *
102:      * @param array $entityTypes
103:      * @return Mage_Eav_Model_Form_Type
104:      */
105:     public function setEntityTypes(array $entityTypes)
106:     {
107:         $this->setData('entity_types', $entityTypes);
108:         return $this;
109:     }
110: 
111:     /**
112:      * Assign Entity Type to Form Type
113:      *
114:      * @param int $entityTypeId
115:      * @return Mage_Eav_Model_Form_Type
116:      */
117:     public function addEntityType($entityTypeId)
118:     {
119:         $entityTypes = $this->getEntityTypes();
120:         if (!empty($entityTypeId) && !in_array($entityTypeId, $entityTypes)) {
121:             $entityTypes[] = $entityTypeId;
122:             $this->setEntityTypes($entityTypes);
123:         }
124:         return $this;
125:     }
126: 
127:     /**
128:      * Copy Form Type properties from skeleton form type
129:      *
130:      * @param Mage_Eav_Model_Form_Type $skeleton
131:      * @return Mage_Eav_Model_Form_Type
132:      */
133:     public function createFromSkeleton(Mage_Eav_Model_Form_Type $skeleton)
134:     {
135:         $fieldsetCollection = Mage::getModel('eav/form_fieldset')->getCollection()
136:             ->addTypeFilter($skeleton)
137:             ->setSortOrder();
138:         $elementCollection = Mage::getModel('eav/form_element')->getCollection()
139:             ->addTypeFilter($skeleton)
140:             ->setSortOrder();
141: 
142:         // copy fieldsets
143:         $fieldsetMap = array();
144:         foreach ($fieldsetCollection as $skeletonFieldset) {
145:             /* @var $skeletonFieldset Mage_Eav_Model_Form_Fieldset */
146:             $fieldset = Mage::getModel('eav/form_fieldset');
147:             $fieldset->setTypeId($this->getId())
148:                 ->setCode($skeletonFieldset->getCode())
149:                 ->setLabels($skeletonFieldset->getLabels())
150:                 ->setSortOrder($skeletonFieldset->getSortOrder())
151:                 ->save();
152:             $fieldsetMap[$skeletonFieldset->getId()] = $fieldset->getId();
153:         }
154: 
155:         // copy elements
156:         foreach ($elementCollection as $skeletonElement) {
157:             /* @var $skeletonElement Mage_Eav_Model_Form_Element */
158:             $element = Mage::getModel('eav/form_element');
159:             $fieldsetId = null;
160:             if ($skeletonElement->getFieldsetId()) {
161:                 $fieldsetId = $fieldsetMap[$skeletonElement->getFieldsetId()];
162:             }
163:             $element->setTypeId($this->getId())
164:                 ->setFieldsetId($fieldsetId)
165:                 ->setAttributeId($skeletonElement->getAttributeId())
166:                 ->setSortOrder($skeletonElement->getSortOrder());
167:         }
168: 
169:         return $this;
170:     }
171: }
172: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0