• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Eav_Model_Entity_Attribute_Backend_Abstract类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: _isCallableAttributeInstance

 /**
  * Check whether attribute instance (attribute, backend, frontend or source) has method and applicable
  *
  * @param Mage_Eav_Model_Entity_Attribute_Abstract|Mage_Eav_Model_Entity_Attribute_Backend_Abstract|Mage_Eav_Model_Entity_Attribute_Frontend_Abstract|Mage_Eav_Model_Entity_Attribute_Source_Abstract $instance
  * @param string $method
  * @param array $args array of arguments
  * @return boolean
  */
 protected function _isCallableAttributeInstance($instance, $method, $args)
 {
     if ($instance instanceof Mage_Eav_Model_Entity_Attribute_Backend_Abstract && ($method == 'beforeSave' || ($method = 'afterSave'))) {
         $attributeCode = $instance->getAttribute()->getAttributeCode();
         if (isset($args[0]) && $args[0] instanceof Varien_Object && $args[0]->getData($attributeCode) === false) {
             return false;
         }
     }
     return parent::_isCallableAttributeInstance($instance, $method, $args);
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:18,代码来源:Abstract.php


示例2: beforeSave

 /**
  * Performed before data is saved
  *
  * @param Varieb_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     if ($object->getShipment()) {
         $object->setParentId($object->getShipment()->getId());
     }
     return parent::beforeSave($object);
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Child.php


示例3: beforeSave

 /**
  * Before save method
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $attributeValue = $object->getData($attributeCode);
     $delimiter = Glace_Menumobile_Block_Category_Attribute_Helper_Dropdown_Blocks::DELIMITER;
     $maxBlocks = Glace_Menumobile_Block_Category_Attribute_Helper_Dropdown_Blocks::MAX_BLOCKS;
     if ($attributeValue) {
         //To make parsing simpler, replace value with empty string if all blocks are empty
         $exploded = explode($delimiter, $attributeValue);
         $allBlocksAreEmpty = TRUE;
         for ($i = 0; $i < $maxBlocks; $i++) {
             if (isset($exploded[$i])) {
                 if (trim($exploded[$i])) {
                     //Block is not empty after trimming
                     $allBlocksAreEmpty = FALSE;
                     break;
                 }
             }
         }
         if ($allBlocksAreEmpty) {
             $object->setData($attributeCode, '');
             //Set empty value
         }
     }
     return parent::beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:32,代码来源:Glace_Menumobile_Model_Category_Attribute_Backend_Dropdown_Blocks.php


示例4: beforeSave

 /**
  * Method is invoked before save
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     if ($object->getCreditmemo()) {
         $object->setParentId($object->getCreditmemo()->getId());
     }
     return parent::beforeSave($object);
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:13,代码来源:Child.php


示例5: beforeSave

 /**
  * Prepare data for save
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $data = $object->getData($attributeCode);
     if (is_array($data)) {
         $data = array_filter($data);
         $object->setData($attributeCode, implode(',', $data));
     }
     return parent::beforeSave($object);
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:16,代码来源:Array.php


示例6: beforeSave

 /**
  * Prepare data for save
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $data = $object->getData($attributeCode);
     if ($data instanceof Varien_Object) {
         $data = get_class($data) . '|' . json_encode($data->getData());
     }
     $object->setData($attributeCode, $data);
     return parent::beforeSave($object);
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:16,代码来源:Json.php


示例7: beforeSave

 /**
  * Prepare inventory data from custom atribute
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract|void
  */
 public function beforeSave($object)
 {
     /** @var $object Mage_Catalog_Model_Product  */
     $stockData = $object->getData($this->getAttribute()->getAttributeCode());
     if ($object->getStockData() !== null || $stockData !== null) {
         $object->setStockData(array_replace((array) $object->getStockData(), (array) $stockData));
     }
     $object->unsetData($this->getAttribute()->getAttributeCode());
     parent::beforeSave($object);
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:16,代码来源:Stock.php


示例8: testGetAffectedFields

 public function testGetAffectedFields()
 {
     $valueId = 10;
     $attributeId = 42;
     $attribute = $this->getMock('Mage_Eav_Model_Entity_Attribute_Abstract', array('getBackendTable', 'isStatic', 'getAttributeId'), array(), '', false);
     $attribute->expects($this->any())->method('getAttributeId')->will($this->returnValue($attributeId));
     $attribute->expects($this->any())->method('isStatic')->will($this->returnValue(false));
     $attribute->expects($this->any())->method('getBackendTable')->will($this->returnValue('table'));
     $this->_model->setAttribute($attribute);
     $object = new Varien_Object();
     $this->_model->setValueId($valueId);
     $this->assertEquals(array('table' => array(array('value_id' => $valueId, 'attribute_id' => $attributeId))), $this->_model->getAffectedFields($object));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:13,代码来源:AbstractTest.php


示例9: afterSave

 /**
  * Save uploaded file and set its name to entity
  *
  * @param Goodahead_Etm_Model_Entity $object
  * @return void
  */
 public function afterSave($object)
 {
     parent::afterSave($object);
     $value = $object->getData($this->getAttribute()->getName());
     if (is_array($value) && !empty($value['delete'])) {
         $object->setData($this->getAttribute()->getName(), '');
         $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());
         return $this;
     }
     $path = Mage::getBaseDir('media') . DS . 'goodahead' . DS . 'etm' . DS . 'images' . DS . $object->getEntityTypeInstance()->getEntityTypeCode() . DS . $this->getAttribute()->getAttributeCode() . DS;
     try {
         $uploader = new Varien_File_Uploader($this->getAttribute()->getName());
         $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
         $uploader->setAllowRenameFiles(true);
         $uploader->setAllowCreateFolders(true);
         $uploader->setFilesDispersion(true);
         $uploader->save($path);
         $object->setData($this->getAttribute()->getName(), $uploader->getUploadedFileName());
         $this->getAttribute()->getEntity()->saveAttribute($object, $this->getAttribute()->getName());
     } catch (Exception $e) {
         if ($e->getCode() != Varien_File_Uploader::TMP_NAME_EMPTY) {
             Mage::logException($e);
         }
         /** @TODO ??? */
         return $this;
     }
     return $this;
 }
开发者ID:eniuz,项目名称:entitytype-manager,代码行数:34,代码来源:Image.php


示例10: beforeSave

 /**
  * Before save method
  *
  * @param  Varien_Object $object Object Model
  * @return FireGento_DynamicCategory_Model_Entity_Attribute_Backend_Rule Self.
  */
 public function beforeSave($object)
 {
     parent::beforeSave($object);
     $attrCode = $this->getAttribute()->getAttributeCode();
     $object->setData($attrCode, serialize($object->getData($attrCode)));
     return $this;
 }
开发者ID:hsq,项目名称:firegento-dynamiccategory,代码行数:13,代码来源:Rule.php


示例11: afterSave

 public function afterSave($object)
 {
     if ($object->getOrderItem()) {
         $object->getOrderItem()->save();
     }
     return parent::beforeSave($object);
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:7,代码来源:Item.php


示例12: afterSave

 public function afterSave($object)
 {
     parent::afterSave($object);
     $object->getItemsCollection()->save();
     $object->getShippingRatesCollection()->save();
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:7,代码来源:Parent.php


示例13: getAttribute

 /**
  * Get attribute instance
  *
  * @return Mage_Eav_Model_Entity_Attribute_Abstract
  */
 public function getAttribute()
 {
     if (is_null($this->_attribute)) {
         $attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_category', 'virtual_category');
         $this->setAttribute($attribute);
     }
     return parent::getAttribute();
 }
开发者ID:anndream,项目名称:smile-magento-elasticsearch,代码行数:13,代码来源:Virtual.php


示例14: beforeSave

 public function beforeSave($object)
 {
     $data = $object->getData($this->getAttribute()->getAttributeCode());
     if (is_array($data)) {
         $object->setData($this->getAttribute()->getAttributeCode(), implode(',', $data));
     }
     return parent::beforeSave($object);
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:8,代码来源:Array.php


示例15: beforeSave

 public function beforeSave($object)
 {
     if ($object->getOrder()) {
         $object->setOrderId($object->getOrder()->getId());
         $object->setBillingAddressId($object->getOrder()->getBillingAddress()->getId());
     }
     return parent::beforeSave($object);
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:8,代码来源:Order.php


示例16: beforeSave

 public function beforeSave($object)
 {
     if ($object->getAddress()) {
         $object->setParentId($object->getAddress()->getId())->setStoreId($object->getAddress()->getStoreId());
     }
     parent::beforeSave($object);
     return $this;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:8,代码来源:Child.php


示例17: beforeSave

 public function beforeSave($object)
 {
     if ($object->getOrder()) {
         $object->setParentId($object->getOrder()->getId());
     }
     parent::beforeSave($object);
     return $this;
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:8,代码来源:Child.php


示例18: afterSave

 public function afterSave($object)
 {
     parent::afterSave($object);
     $object->getAddressesCollection()->save();
     $object->getItemsCollection()->save();
     $object->getPaymentsCollection()->save();
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:8,代码来源:Parent.php


示例19: validate

 /**
  * Validate SKU
  *
  * @param Mage_Catalog_Model_Product $object
  * @throws Mage_Core_Exception
  * @return bool
  */
 public function validate($object)
 {
     $helper = Mage::helper('core/string');
     if ($helper->strlen($object->getSku()) > self::SKU_MAX_LENGTH) {
         Mage::throwException(Mage::helper('catalog')->__('SKU length should be %s characters maximum.', self::SKU_MAX_LENGTH));
     }
     return parent::validate($object);
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:15,代码来源:Sku.php


示例20: afterLoad

 /**
  * Convert create date from UTC to current store time zone
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Time_Created
  */
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $date = $object->getData($attributeCode);
     $zendDate = Mage::app()->getLocale()->storeDate(null, $date, true);
     $object->setData($attributeCode, $zendDate->getIso());
     parent::afterLoad($object);
     return $this;
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:15,代码来源:Created.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap