Skip to content

Instantly share code, notes, and snippets.

@mark-netalico
Forked from ltcdnunez/Abstract.php
Created December 11, 2013 19:55
Show Gist options
  • Save mark-netalico/7917297 to your computer and use it in GitHub Desktop.
Save mark-netalico/7917297 to your computer and use it in GitHub Desktop.
Magento Overrride with patch for fixing the db deadlock error issue
FILE PATH:
/var/www/dev.linentablecloth.com/app/code/local/Mage/Sales/Model/Abstract.php
SOURCE CODE:
<?php
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition License
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magentocommerce.com/license/enterprise-edition
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Sales
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://www.magentocommerce.com/license/enterprise-edition
*/
/**
* Sales abstract model
* Provide date processing functionality
*
* @author Magento Core Team <core@magentocommerce.com>
*/
abstract class Mage_Sales_Model_Abstract extends Mage_Core_Model_Abstract
{
/**
* Get object store identifier
*
* @return int | string | Mage_Core_Model_Store
*/
abstract public function getStore();
/**
* Processing object after save data
* Updates relevant grid table records.
*
*/
// LTC CUSTOM Mark C 2012.11.20
public function afterCommitCallback()
{
if (!$this->getForceUpdateGridRecords()) {
$this->_getResource()->updateGridRecords($this->getId());
}
parent::afterCommitCallback();
// END
}
/**
* Get object created at date affected current active store timezone
*
* @return Zend_Date
*/
public function getCreatedAtDate()
{
return Mage::app()->getLocale()->date(
Varien_Date::toTimestamp($this->getCreatedAt()),
null,
null,
true
);
}
/**
* Get object created at date affected with object store timezone
*
* @return Zend_Date
*/
public function getCreatedAtStoreDate()
{
return Mage::app()->getLocale()->storeDate(
$this->getStore(),
Varien_Date::toTimestamp($this->getCreatedAt()),
true
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment