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


PHP Mage_Core_Model_Abstract::delete方法代码示例

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


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

示例1: tearDown

 /**
  * Reset current store to admin and clean up created customer entity
  */
 protected function tearDown()
 {
     $this->setCurrentStore('admin');
     if ($this->_model && $this->_model->getId()) {
         $this->_model->delete();
     }
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:10,代码来源:ObserverTest.php

示例2: delete

 /**
  * Deletion of segment
  */
 public function delete()
 {
     AW_Advancednewsletter_Model_Sync_Mailchimpclient::$disableAutosync = true;
     $segmentCode = $this->getCode();
     parent::delete();
     Mage::getModel('advancednewsletter/subscriber')->getCollection()->removeSegment($segmentCode);
     Mage::dispatchEvent('an_segment_delete', array('segment_code' => $segmentCode));
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:11,代码来源:Segment.php

示例3: delete

 public function delete()
 {
     $itemId = $this->getId();
     if ($itemId == Aitoc_Aitcg_Helper_Font_Color_Set::XPATH_CONFIG_AITCG_FONT_COLOR_SET_DFLT) {
         return;
     }
     parent::delete();
 }
开发者ID:Eximagen,项目名称:BulletMagento,代码行数:8,代码来源:Set.php

示例4: _testDelete

 protected function _testDelete()
 {
     $modelId = $this->_model->getId();
     $this->_model->delete();
     $model = $this->_getEmptyModel();
     $model->load($modelId);
     PHPUnit_Framework_Assert::assertEmpty($model->getId(), 'CRUD Delete error');
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:Entity.php

示例5: delete

 public function delete()
 {
     if (is_null($this->getId())) {
         throw new LogicException('Method require loaded instance first');
     }
     $this->deleteObjectLocks();
     return parent::delete();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:8,代码来源:Abstract.php

示例6: delete

 public function delete()
 {
     $collection = Mage::getModel('Query_NovaPontoCom/ticket_log')->getCollection();
     $collection->addFieldToFilter('ticket_id', $this->getId());
     foreach ($collection as $log) {
         $log->delete();
     }
     parent::delete();
 }
开发者ID:Hospeed,项目名称:extra-marketplace,代码行数:9,代码来源:Ticket.php

示例7: delete

 public function delete()
 {
     if ($this->getFilename()) {
         $fullPath = $this->getImagesPath() . $this->getFilename();
         @unlink($fullPath);
         $fullPath = $this->getImagesPath() . 'preview' . DS . $this->getFilename();
         @unlink($fullPath);
     }
     return parent::delete();
 }
开发者ID:Eximagen,项目名称:BulletMagento,代码行数:10,代码来源:Image.php

示例8: delete

 public function delete()
 {
     $hashOptions = unserialize($this->getHashOptions());
     if (is_array($hashOptions) && !empty($hashOptions)) {
         foreach ($hashOptions as $hashOption) {
             Mage::helper('customoptions')->deleteOptionFile($this->getId(), $hashOption['id']);
             @rmdir(Mage::helper('customoptions')->getCustomOptionsPath($this->getId()));
         }
     }
     parent::delete();
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:11,代码来源:Group.php

示例9: delete

 public function delete()
 {
     $hashOptions = unserialize($this->getHashOptions());
     if (is_array($hashOptions) && !empty($hashOptions)) {
         foreach ($hashOptions as $hashOption) {
             Mage::getSingleton('catalog/product_option')->removeOptionFile($this->getId(), $hashOption['id'], false, true);
             @rmdir(Mage::helper('customoptions')->getCustomOptionsPath($this->getId()));
         }
     }
     parent::delete();
 }
开发者ID:parmanandsagar-mobikasa,项目名称:CO,代码行数:11,代码来源:Group.php

示例10: _undo

 /**
  * Delete model
  *
  * @param Mage_Core_Model_Abstract $duplicate
  */
 protected function _undo($duplicate)
 {
     Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
     $duplicate->delete();
 }
开发者ID:nemphys,项目名称:magento2,代码行数:10,代码来源:ProductTest.php

示例11: delete

 public function delete()
 {
     $this->getResource()->deleteEmails($this->getId());
     parent::delete();
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:5,代码来源:Session.php

示例12: delete

 /**
  * Deleting subscriber
  */
 public function delete()
 {
     Mage::dispatchEvent('an_subscriber_delete', array('subscriber' => $this));
     parent::delete();
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:8,代码来源:Subscriber.php

示例13: delete

 /**
  * Delete record form database and cached page. 
  * NOT USED FOR DELETE MORE MODELS. USE deleteCollection() !!!
  */
 public function delete()
 {
     $this->getFileModel()->deletePage();
     parent::delete();
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:9,代码来源:Mturbo.php

示例14: delete

 /**
  * Delete the data associated with the loaded session
  *
  * @return void
  */
 public function delete()
 {
     /* @var Listrak_Remarketing_Model_Mysql4_Session $resource */
     $resource = $this->getResource();
     $resource->deleteEmails($this->getId());
     parent::delete();
 }
开发者ID:RxOuchy,项目名称:LDS_Client_Solutions,代码行数:12,代码来源:Session.php

示例15: save

 /**
  * Save object
  *
  * @param Cm_Mongo_Model_Abstract|Mage_Core_Model_Abstract $object
  * @throws Mage_Core_Exception
  * @throws MongoCursorException
  * @return  Cm_Mongo_Model_Resource_Abstract
  */
 public function save(Mage_Core_Model_Abstract $object)
 {
     if ($object->isDeleted()) {
         return $object->delete();
     }
     $this->_beforeSave($object);
     $object->setLastUpdateStatus(NULL);
     // TRUE, do insert
     if ($object->isObjectNew()) {
         // Set created and updated timestamps
         $this->setTimestamps($object, $this->getEntitySchema()->created_timestamp, $this->getEntitySchema()->updated_timestamp);
         // Collect data for mongo
         $data = $this->dehydrate($object);
         $ops = $object->getPendingOperations();
         // Set autoincrement
         if (empty($data['_id']) && $this->getEntitySchema()->autoincrement) {
             $data['_id'] = $this->getAutoIncrement();
         }
         // Translate $set operations to simple insert data if possible
         if (isset($ops['$set'])) {
             foreach ($ops['$set'] as $key => $value) {
                 if (strpos($key, '.') === false) {
                     $data[$key] = $value;
                     unset($ops['$set'][$key]);
                 }
                 // @TODO - expand . delimited keys
             }
             if (!count($ops['$set'])) {
                 unset($ops['$set']);
             }
         }
         // Get insert options, merge default with instance-specific options
         $options = array('safe' => TRUE);
         if ($additionalSaveOptions = $object->getAdditionalSaveOptions()) {
             unset($additionalSaveOptions['upsert'], $additionalSaveOptions['multiple']);
             $options = array_merge($options, $additionalSaveOptions);
         }
         // Insert document (throws exception on failure)
         $this->_getWriteCollection()->insert($data, $options);
         if (!$object->hasData('_id') || $data['_id'] != $object->getData('_id')) {
             $object->setData('_id', $data['_id'])->setOrigData('_id', $data['_id']);
         }
         // Execute any pending operations
         if ($ops) {
             $object->setLastUpdateStatus($this->update($object, $ops));
         } else {
             if ($object->getAdditionalSaveCriteria()) {
                 $object->setAdditionalSaveCriteria();
                 $object->setLastUpdateStatus(TRUE);
             }
         }
     } else {
         if ($object->isObjectNew() === FALSE) {
             if (!$object->getId()) {
                 throw new Mage_Core_Exception('Cannot save existing object without id.');
             }
             // Set updated timestamp only
             $this->setTimestamps($object, FALSE, $this->getEntitySchema()->updated_timestamp);
             // Collect data for mongo and update using atomic operators
             $data = $this->getDataChangesForUpdate($object);
             $ops = $object->getPendingOperations();
             if (isset($ops['$set'])) {
                 $ops['$set'] = array_merge($data, (array) $ops['$set']);
             } else {
                 if ($data) {
                     $ops['$set'] = $data;
                 }
             }
             // Undo unsets that are overridden by sets
             if (isset($ops['$unset']) && isset($ops['$set'])) {
                 foreach ($ops['$unset'] as $key => $value) {
                     if (isset($ops['$set'][$key])) {
                         unset($ops['$unset'][$key]);
                     }
                 }
                 if (!count($ops['$unset'])) {
                     unset($ops['$unset']);
                 }
             }
             if ($ops) {
                 $object->setLastUpdateStatus($this->update($object, $ops));
             }
         } else {
             // Created timestamps not available on upsert
             $this->setTimestamps($object, FALSE, $this->getEntitySchema()->updated_timestamp);
             // Collect data for upsert. If no operations then use data, otherwise add data to $set operation
             $data = $this->dehydrate($object);
             if ($ops = $object->getPendingOperations()) {
                 if (isset($ops['$set'])) {
                     $ops['$set'] = array_merge($data, (array) $ops['$set']);
                 } else {
                     $ops['$set'] = $data;
//.........这里部分代码省略.........
开发者ID:walexer,项目名称:magento-mongo,代码行数:101,代码来源:Abstract.php


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