Created
November 22, 2012 05:36
-
-
Save mclevenger/4129559 to your computer and use it in GitHub Desktop.
Magento Overrride with patch for fixing the db deadlock error issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected] 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 <[email protected]> | |
*/ | |
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. | |
* | |
* @return Mage_Core_Model_Abstract | |
*/ | |
// LTC CUSTOM Mark C 2012.11.20 | |
// protected function _afterSave() | |
public function afterCommitCallback() | |
{ | |
Mage::log("Using new sales grid save patch"); | |
if (!$this->getForceUpdateGridRecords()) { | |
$this->_getResource()->updateGridRecords($this->getId()); | |
} | |
// return parent::_afterSave(); | |
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