本文整理汇总了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();
}
}
示例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));
}
示例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();
}
示例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');
}
示例5: delete
public function delete()
{
if (is_null($this->getId())) {
throw new LogicException('Method require loaded instance first');
}
$this->deleteObjectLocks();
return parent::delete();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例11: delete
public function delete()
{
$this->getResource()->deleteEmails($this->getId());
parent::delete();
}
示例12: delete
/**
* Deleting subscriber
*/
public function delete()
{
Mage::dispatchEvent('an_subscriber_delete', array('subscriber' => $this));
parent::delete();
}
示例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();
}
示例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();
}
示例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;
//.........这里部分代码省略.........