当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Eav_Model_Entity_Attribute::_beforeSave方法代码示例

本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute::_beforeSave方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute::_beforeSave方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute::_beforeSave怎么用?PHP Mage_Eav_Model_Entity_Attribute::_beforeSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Eav_Model_Entity_Attribute的用法示例。


在下文中一共展示了Mage_Eav_Model_Entity_Attribute::_beforeSave方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _beforeSave

 protected function _beforeSave()
 {
     if ($this->getFrontendInput() == "image") {
         $this->setBackendModel('catalog/category_attribute_backend_image');
         $this->setBackendType('varchar');
     }
     if ($this->getFrontendInput() == "date") {
         $this->setBackendModel('eav/entity_attribute_backend_datetime');
         $this->setBackendType('datetime');
     }
     if ($this->getFrontendInput() == "textarea") {
         $this->setBackendType('text');
     }
     if ($this->getFrontendInput() == "text") {
         $this->setBackendType('varchar');
     }
     if ($this->getFrontendInput() == "multiselect" || $this->getFrontendInput() == "select") {
         $this->setData('source_model', 'eav/entity_attribute_source_table');
         $this->setBackendType('varchar');
     }
     if ($this->getFrontendInput() == "boolean") {
         $this->setFrontendInput("select");
         $this->setBackendType('int');
         $this->setData('source_model', 'eav/entity_attribute_source_boolean');
     }
     return parent::_beforeSave();
 }
开发者ID:remiebeling,项目名称:Hwg_Attributemanager,代码行数:27,代码来源:Attributemanager.php

示例2: _beforeSave

 /**
  * Processing object before save data
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _beforeSave()
 {
     $this->setData('modulePrefix', self::MODULE_NAME);
     if (isset($this->_origData['is_global'])) {
         if (!isset($this->_data['is_global'])) {
             Mage::throwException('0_o');
         }
         if ($this->_data['is_global'] != $this->_origData['is_global'] && $this->_getResource()->isUsedBySuperProducts($this)) {
             Mage::throwException(Mage::helper('eav')->__('Scope must not be changed, because the attribute is used in configurable products.'));
         }
     }
     if ($this->getFrontendInput() == 'price') {
         if (!$this->getBackendModel()) {
             $this->setBackendModel('catalog/product_attribute_backend_price');
         }
     }
     return parent::_beforeSave();
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:23,代码来源:Attribute.php

示例3: _beforeSave

 /**
  * Processing object before save data
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _beforeSave()
 {
     if ($this->_getResource()->isUsedBySuperProducts($this)) {
         throw Mage::exception('Mage_Eav', Mage::helper('eav')->__('This attribute is used in configurable products'));
     }
     $this->setData('modulePrefix', self::MODULE_NAME);
     return parent::_beforeSave();
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:13,代码来源:Attribute.php

示例4: _beforeSave

 /**
  * Processing object before save data
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _beforeSave()
 {
     $this->setData('modulePrefix', self::MODULE_NAME);
     return parent::_beforeSave();
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:10,代码来源:Attribute.php

示例5: _beforeSave

 /**
  * Processing object before save data
  *
  * @throws Mage_Core_Exception
  * @return Mage_Core_Model_Abstract
  */
 protected function _beforeSave()
 {
     $this->setData('modulePrefix', self::MODULE_NAME);
     if (isset($this->_origData['is_global'])) {
         if (!isset($this->_data['is_global'])) {
             $this->_data['is_global'] = self::SCOPE_GLOBAL;
         }
         if ($this->_data['is_global'] != $this->_origData['is_global'] && $this->_getResource()->isUsedBySuperProducts($this)) {
             Mage::throwException(Mage::helper('blog')->__('Scope must not be changed, because the attribute is used in configurable products.'));
         }
     }
     if ($this->getFrontendInput() == 'textarea') {
         if ($this->getIsWysiwygEnabled()) {
             $this->setIsHtmlAllowedOnFront(1);
         }
     }
     return parent::_beforeSave();
 }
开发者ID:technomagegithub,项目名称:magento,代码行数:24,代码来源:Attribute.php


注:本文中的Mage_Eav_Model_Entity_Attribute::_beforeSave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。