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


PHP Mage_Core_Model_Abstract类代码示例

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


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

示例1: _beforeSave

 /**
  * Action before save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Api_Model_Resource_Acl_Role
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         $this->setCreated(Mage::getSingleton('core/date')->gmtDate());
     }
     return $this;
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:13,代码来源:Role.php

示例2: _afterLoad

 /**
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getData('additional')) {
         $object->setData('additional', Mage::helper('core')->jsonDecode($object->getData('additional')));
     }
     return parent::_afterLoad($object);
 }
开发者ID:shakhawat4g,项目名称:Magento-Gallery-Extension,代码行数:11,代码来源:Item.php

示例3: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->getData('condition_note') === '') {
         $object->setData('condition_note', new Zend_Db_Expr("''"));
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:beut,代码行数:7,代码来源:Product.php

示例4: prepareLineItems

 public function prepareLineItems(Mage_Core_Model_Abstract $salesEntity, $discountTotalAsItem = true, $shippingTotalAsItem = false)
 {
     $items = array();
     foreach ($salesEntity->getAllItems() as $item) {
         if (!$item->getParentItem()) {
             $items[] = new Varien_Object($this->_prepareLineItemFields($salesEntity, $item));
         }
     }
     $discountAmount = 0;
     // this amount always includes the shipping discount
     $shippingDescription = '';
     if ($salesEntity instanceof Mage_Sales_Model_Order) {
         $discountAmount = abs(1 * $salesEntity->getBaseDiscountAmount() + Mage::getSingleton('checkout/session')->getDiscount());
         $shippingDescription = $salesEntity->getShippingDescription();
         $totals = array('subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount, 'tax' => $salesEntity->getBaseTaxAmount(), 'shipping' => $salesEntity->getBaseShippingAmount());
     } else {
         $address = $salesEntity->getIsVirtual() ? $salesEntity->getBillingAddress() : $salesEntity->getShippingAddress();
         $discountAmount = abs(1 * $address->getBaseDiscountAmount() + Mage::getSingleton('checkout/session')->getDiscount());
         $shippingDescription = $address->getShippingDescription();
         $totals = array('subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount, 'tax' => $address->getBaseTaxAmount(), 'shipping' => $address->getBaseShippingAmount(), 'discount' => $discountAmount);
     }
     // discount total as line item (negative)
     if ($discountTotalAsItem && $discountAmount) {
         $items[] = new Varien_Object(array('name' => Mage::helper('paypal')->__('Discount'), 'qty' => 1, 'amount' => -1.0 * $discountAmount));
     }
     Mage::log($discountAmount . "|" . Mage::getSingleton('checkout/session')->getDiscount());
     // shipping total as line item
     if ($shippingTotalAsItem && !$salesEntity->getIsVirtual() && (double) $totals['shipping']) {
         $items[] = new Varien_Object(array('id' => Mage::helper('paypal')->__('Shipping'), 'name' => $shippingDescription, 'qty' => 1, 'amount' => (double) $totals['shipping']));
     }
     return array($items, $totals, $discountAmount, $totals['shipping']);
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:32,代码来源:Paypal.php

示例5: _afterDelete

 protected function _afterDelete(Mage_Core_Model_Abstract $object)
 {
     //delete values
     $this->_getReadAdapter()->delete($this->getTable('webforms/results_values'), 'field_id =' . $object->getId());
     Mage::dispatchEvent('webforms_field_delete', array('field' => $object));
     return parent::_afterDelete($object);
 }
开发者ID:monarcmoso,项目名称:beta2,代码行数:7,代码来源:SingPost_WebForms_Model_Mysql4_Fields.php

示例6: isVersionHasPublishedRevision

 /**
  * Checking if Version does not contain published revision
  *
  * @param Mage_Core_Model_Abstract $object
  * @return bool
  */
 public function isVersionHasPublishedRevision(Mage_Core_Model_Abstract $object)
 {
     $select = $this->_getReadAdapter()->select();
     $select->from(array('p' => $this->getTable('cms/page')), array())->where('p.page_id = ?', (int) $object->getPageId())->join(array('r' => $this->getTable('enterprise_cms/page_revision')), 'r.revision_id = p.published_revision_id', 'r.version_id');
     $result = $this->_getReadAdapter()->fetchOne($select);
     return $result == $object->getVersionId();
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:13,代码来源:Version.php

示例7: _afterSave

 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     /** @var  Mirasvit_Helpdesk_Model_Status $object */
     if (!$object->getIsMassStatus()) {
     }
     return parent::_afterSave($object);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:7,代码来源:Status.php

示例8: _beforeDelete

 protected function _beforeDelete(Mage_Core_Model_Abstract $object)
 {
     // Cleanup stats on slideshow delete
     $adapter = $this->_getWriteAdapter();
     // 1. Delete slideshow/store
     $adapter->delete($this->getTable('mp_slideshow/store'), 'slideshow_id=' . $object->getId());
 }
开发者ID:remiebeling,项目名称:MageProfis_Slideshow,代码行数:7,代码来源:Slideshow.php

示例9: _afterSave

 /**
  * Save entity types after save form type
  *
  * @param Mage_Eav_Model_Form_Type $object
  * @see Mage_Core_Model_Mysql4_Abstract#_afterSave($object)
  * @return Mage_Eav_Model_Mysql4_Form_Type
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->hasEntityTypes()) {
         $new = $object->getEntityTypes();
         $old = $this->getEntityTypes($object);
         $insert = array_diff($new, $old);
         $delete = array_diff($old, $new);
         $write = $this->_getWriteAdapter();
         if (!empty($insert)) {
             $data = array();
             foreach ($insert as $entityId) {
                 if (empty($entityId)) {
                     continue;
                 }
                 $data[] = array('entity_type_id' => (int) $entityId, 'type_id' => $object->getId());
             }
             if ($data) {
                 $write->insertMultiple($this->getTable('eav/form_type_entity'), $data);
             }
         }
         if (!empty($delete)) {
             $where = join(' AND ', array($write->quoteInto('type_id=?', $object->getId()), $write->quoteInto('entity_type_id IN(?)', $delete)));
             $write->delete($this->getTable('eav/form_type_entity'), $where);
         }
     }
     return parent::_afterSave($object);
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:34,代码来源:Type.php

示例10: setProgramIsProcessed

 public function setProgramIsProcessed(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         return $this;
     }
     return $this->save($object->setIsProcess('1'));
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:7,代码来源:Program.php

示例11: getChildren

 public function getChildren(Mage_Core_Model_Abstract $object)
 {
     /** @var Magpleasure_Common_Model_Resource_Treeview_Collection_Abstract $collection */
     $collection = $object->getCollection();
     $collection->addFieldToFilter($this->getParentIdField(), $object->getData($this->getParentIdField()))->setOrder($this->getPositionField(), 'ASC');
     return $collection;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:7,代码来源:Abstract.php

示例12: _syncStore

 protected function _syncStore(Mage_Core_Model_Abstract $object)
 {
     $collection = Mage::getModel('menu/item')->getCollection()->addFieldToFilter('menu_id', $object->getId());
     foreach ($collection as $item) {
         $item->setStoreIds($object->getStoreIds())->save();
     }
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Menu.php

示例13: _beforeSave

 /**
  * Perform operations before object save
  *
  * @param Mage_Cms_Model_Block $object
  * @return Creativestyle_CheckoutByAmazon_Model_Mysql4_Log_Abstract
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         $object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
     }
     return parent::_beforeSave($object);
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:13,代码来源:Abstract.php

示例14: _afterSave

 /**
  * Call-back function
  */
 protected function _afterSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getIsMassStatus()) {
         $this->_saveToStoreTable($object);
     }
     return parent::_afterSave($object);
 }
开发者ID:technomagegithub,项目名称:olgo.nl,代码行数:10,代码来源:Rewrite.php

示例15: extractEavAttributeValue

 /**
  * @param string                   $attributeCode
  * @param Mage_Core_Model_Abstract $object
  *
  * @return null|string
  */
 public function extractEavAttributeValue($attributeCode = null, Mage_Core_Model_Abstract $object)
 {
     if (!empty($attributeCode) && $object->hasData($attributeCode)) {
         return $object->getData($attributeCode);
     }
     return null;
 }
开发者ID:marcoescudeiro,项目名称:clickpag-magento,代码行数:13,代码来源:Attributes.php


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