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


PHP Mage_Eav_Model_Entity_Abstract类代码示例

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


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

示例1: _setAttribteValue

 /**
  * Initialize attribute value for object
  *
  * @param   Varien_Object $object
  * @param   array $valueRow
  * @return  Mage_Eav_Model_Entity_Abstract
  */
 protected function _setAttribteValue($object, $valueRow)
 {
     parent::_setAttribteValue($object, $valueRow);
     if ($attribute = $this->getAttribute($valueRow['attribute_id'])) {
         $attributeCode = $attribute->getAttributeCode();
         if (isset($valueRow['store_value'])) {
             $object->setAttributeDefaultValue($attributeCode, $valueRow['value']);
             $object->setData($attributeCode, $valueRow['store_value']);
             $attribute->getBackend()->setValueId($valueRow['store_value_id']);
         }
     }
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:20,代码来源:Abstract.php

示例2: getAlias

 /**
  * Get attribute alias as "entity_type/attribute_code"
  *
  * @param Mage_Eav_Model_Entity_Abstract $entity exclude this entity
  * @return string
  */
 public function getAlias($entity = null)
 {
     $alias = '';
     if ($entity === null || $entity->getType() !== $this->getEntity()->getType()) {
         $alias .= $this->getEntity()->getType() . '/';
     }
     $alias .= $this->getAttributeCode();
     return $alias;
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:15,代码来源:Abstract.php

示例3: _getCarriers

 /**
  * Retrieve shipping carriers for specified order
  *
  * @param Mage_Eav_Model_Entity_Abstract $object
  * @return array
  */
 protected function _getCarriers($object)
 {
     $carriers = array();
     $carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers($object->getStoreId());
     $carriers['custom'] = Mage::helper('sales')->__('Custom Value');
     foreach ($carrierInstances as $code => $carrier) {
         if ($carrier->isTrackingAvailable()) {
             $carriers[$code] = $carrier->getConfigData('title');
         }
     }
     return $carriers;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:18,代码来源:Api.php

示例4: _getFitHeight

 /**
  * Added a fit size for items in large quantities.
  * Means you can join items like two or more glasses, pots and vases.
  * The calc is applied only for height side.
  * Required attribute fit_size. Example:
  *
  *         code: fit_size
  *         type: varchar
  *
  * After you can set a fit size for all products and improve your sells
  *
  * @param Mage_Eav_Model_Entity_Abstract $item Order Item
  *
  * @return number
  */
 protected function _getFitHeight($item)
 {
     $product = $item->getProduct();
     $height = $product->getData('volume_altura');
     $height = $height > 0 ? $height : (int) $this->getConfigData('altura_padrao');
     $fitSize = (double) $product->getData('fit_size');
     if ($item->getQty() > 1 && is_numeric($fitSize) && $fitSize > 0) {
         $totalSize = $height + $fitSize * ($item->getQty() - 1);
         $height = $totalSize / $item->getQty();
     }
     return $height;
 }
开发者ID:NelisRodrigues,项目名称:correios,代码行数:27,代码来源:CorreiosMethod.php

示例5: _afterSave

 /**
  * Save customer addresses and set default addresses in attributes backend
  *
  * @param   Varien_Object $customer
  * @return  Mage_Eav_Model_Entity_Abstract
  */
 protected function _afterSave(Varien_Object $customer)
 {
     $this->_saveAddresses($customer);
     return parent::_afterSave($customer);
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:11,代码来源:Customer.php

示例6: testCompareAttributes

 /**
  * @param array $attribute1SetInfo
  * @param array $attribute2SetInfo
  * @param float $expected
  * @dataProvider compareAttributesDataProvider
  */
 public function testCompareAttributes($attribute1Sort, $attribute2Sort, $expected)
 {
     $attribute1 = $this->getMock('Mage_Eav_Model_Entity_Attribute', null, array(), '', false);
     $attribute1->setAttributeSetInfo(array(0 => $attribute1Sort));
     $attribute2 = $this->getMock('Mage_Eav_Model_Entity_Attribute', null, array(), '', false);
     $attribute2->setAttributeSetInfo(array(0 => $attribute2Sort));
     $this->assertEquals($expected, $this->_model->attributesCompare($attribute1, $attribute2));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:AbstractTest.php

示例7: _getLoadRowSelect

 /**
  * Retrieve select object for loading base entity row
  *
  * @param   Varien_Object $object
  * @param   mixed $rowId
  * @return  Zend_Db_Select
  */
 protected function _getLoadRowSelect($object, $rowId)
 {
     $select = parent::_getLoadRowSelect($object, $rowId);
     if ($object->getSharedStoreIds()) {
         $select->where('store_id IN (?)', $object->getSharedStoreIds());
     }
     return $select;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:15,代码来源:Quote.php

示例8: _collectSaveData

 protected function _collectSaveData($newObject)
 {
     // when deleting store specific values, value ids should be in place
     if ($newObject->getStoreId()) {
         foreach ($this->getAttributesByCode() as $code => $attribute) {
             if ($attribute->getIsGlobal() == Mana_Core_Model_Attribute_Scope::_STORE && is_null($newObject->getData($code))) {
                 $attribute->getBackend()->setValueId($this->getStoreValueId($newObject, $attribute));
             }
         }
     }
     return parent::_collectSaveData($newObject);
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:12,代码来源:Eav.php

示例9: load

 /**
  * Reset firstly loaded attributes
  *
  * @param Varien_Object $object
  * @param integer $entityId
  * @param array|null $attributes
  * @return Mage_Catalog_Model_Resource_Abstract
  */
 public function load($object, $entityId, $attributes = array())
 {
     $this->_attributes = array();
     return parent::load($object, $entityId, $attributes);
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:13,代码来源:Abstract.php

示例10: _construct

 /**
  * Emulate customer resource model for easy access
  */
 protected function _construct()
 {
     $this->setType('customer');
     $this->setConnection('customer_read', 'customer_write');
     return parent::_construct();
 }
开发者ID:dwdonline,项目名称:B2BProfessional,代码行数:9,代码来源:Customer.php

示例11: getAttribute

 /**
  * Enter description here...
  *
  * @return Mage_Eav_Model_Entity_Attribute_Abstract
  */
 public function getAttribute($attr)
 {
     return $this->_entity->getAttribute($attr);
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:9,代码来源:Collection.php

示例12: setNewIncrementId

 /**
  * Custom setter of increment ID if its needed
  *
  * @param Varien_Object $object
  * @return Mage_Customer_Model_Resource_Customer
  */
 public function setNewIncrementId(Varien_Object $object)
 {
     if (Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_GENERATE_HUMAN_FRIENDLY_ID)) {
         parent::setNewIncrementId($object);
     }
     return $this;
 }
开发者ID:relue,项目名称:magento2,代码行数:13,代码来源:Customer.php

示例13: _getLoadRowSelect

 /**
  * Retrieve select object for loading base entity row
  *
  * @param   Varien_Object $object
  * @param   mixed $rowId
  * @return  Zend_Db_Select
  */
 protected function _getLoadRowSelect($object, $rowId)
 {
     $select = parent::_getLoadRowSelect($object, $rowId);
     if ($object->getWebsiteId() && $object->getSharingConfig()->isWebsiteScope()) {
         $select->where('website_id=?', (int) $object->getWebsiteId());
     }
     return $select;
 }
开发者ID:Rinso,项目名称:magento-mirror,代码行数:15,代码来源:Customer.php

示例14: _beforeSave

 /**
  * @param Varien_Object $object
  * @return $this
  */
 protected function _beforeSave(Varien_Object $object)
 {
     parent::_beforeSave($object);
     $this->_changeTime($object);
     return $this;
 }
开发者ID:sereban,项目名称:magento-marketo-integration,代码行数:10,代码来源:Abstract.php

示例15: _beforeSave

 /**
  * Check customer address before saving
  *
  * @param Varien_Object $address
  * @return Mage_Customer_Model_Resource_Address
  */
 protected function _beforeSave(Varien_Object $address)
 {
     parent::_beforeSave($address);
     $this->_validate($address);
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:12,代码来源:Address.php


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