Skip to content

Commit

Permalink
Remove oldFields mapping to speed up system
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinNowakMacopedia committed Apr 20, 2022
1 parent e15d959 commit 40808b6
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 214 deletions.
15 changes: 0 additions & 15 deletions app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,6 @@ protected function _construct()
$this->_init('cataloginventory/stock_item');
}

/**
* Init mapping array of short fields to
* its full names
*
* @resturn Varien_Object
*/
protected function _initOldFieldsMap()
{
// pre 1.6 fields names, old => new
$this->_oldFieldsMap = array(
'stock_status_changed_automatically' => 'stock_status_changed_auto',
'use_config_enable_qty_increments' => 'use_config_enable_qty_inc'
);
}

/**
* Retrieve stock identifier
*
Expand Down
17 changes: 0 additions & 17 deletions app/code/core/Mage/Sales/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,23 +423,6 @@ protected function _construct()
$this->_init('sales/order');
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
// pre 1.6 fields names, old => new
$this->_oldFieldsMap = [
'payment_authorization_expiration' => 'payment_auth_expiration',
'forced_do_shipment_with_invoice' => 'forced_shipment_with_invoice',
'base_shipping_hidden_tax_amount' => 'base_shipping_hidden_tax_amnt',
];
return $this;
}

/**
* Clear order object data
*
Expand Down
11 changes: 0 additions & 11 deletions app/code/core/Mage/Sales/Model/Order/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ protected function _construct()
$this->_init('sales/order_address');
}

/**
* Init mapping array of short fields to its full names
*
* @return $this
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('order_address');
return $this;
}

/**
* Set order
*
Expand Down
11 changes: 0 additions & 11 deletions app/code/core/Mage/Sales/Model/Order/Creditmemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,6 @@ protected function _construct()
$this->_init('sales/order_creditmemo');
}

/**
* Init mapping array of short fields to its full names
*
* @return $this
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('order_creditmemo');
return $this;
}

/**
* Retrieve Creditmemo configuration model
*
Expand Down
15 changes: 0 additions & 15 deletions app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ public function setCreditmemo(Mage_Sales_Model_Order_Creditmemo $creditmemo)
return $this;
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
// pre 1.6 fields names, old => new
$this->_oldFieldsMap = [
'base_weee_tax_applied_row_amount' => 'base_weee_tax_applied_row_amnt',
];
return $this;
}

/**
* Retrieve creditmemo instance
*
Expand Down
12 changes: 0 additions & 12 deletions app/code/core/Mage/Sales/Model/Order/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,6 @@ protected function _construct()
$this->_init('sales/order_invoice');
}


/**
* Init mapping array of short fields to its full names
*
* @return $this
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('order_invoice');
return $this;
}

/**
* Load invoice by increment id
*
Expand Down
14 changes: 0 additions & 14 deletions app/code/core/Mage/Sales/Model/Order/Invoice/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,6 @@ function _construct()
$this->_init('sales/order_invoice_item');
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
// pre 1.6 fields names, old => new
$this->_oldFieldsMap = [
'base_weee_tax_applied_row_amount' => 'base_weee_tax_applied_row_amnt',
];
return $this;
}
/**
* Declare invoice instance
*
Expand Down
15 changes: 0 additions & 15 deletions app/code/core/Mage/Sales/Model/Order/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,6 @@ protected function _construct()
$this->_init('sales/order_item');
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
// pre 1.6 fields names, old => new
$this->_oldFieldsMap = [
'base_weee_tax_applied_row_amount' => 'base_weee_tax_applied_row_amnt',
];
return $this;
}

/**
* Prepare data before save
*
Expand Down
11 changes: 0 additions & 11 deletions app/code/core/Mage/Sales/Model/Order/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,6 @@ protected function _construct()
$this->_init('sales/order_shipment');
}

/**
* Init mapping array of short fields to its full names
*
* @return $this
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('order_shipment');
return $this;
}

/**
* Load shipment by increment id
*
Expand Down
13 changes: 0 additions & 13 deletions app/code/core/Mage/Sales/Model/Order/Shipment/Track.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@ function _construct()
$this->_init('sales/order_shipment_track');
}

/**
* Init mapping array of short fields to
* its full names
*
* @resturn Varien_Object
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = array(
'number' => 'track_number'
);
}

/**
* Back compatibility with old versions.
*
Expand Down
14 changes: 1 addition & 13 deletions app/code/core/Mage/Sales/Model/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,6 @@ protected function _construct()
$this->_init('sales/quote');
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('quote');
return $this;
}

/**
* Get quote store identifier
*
Expand Down Expand Up @@ -839,7 +827,7 @@ public function getItemById($itemId)
if ($item->getId() == $itemId) {
$quoteItem = $item;
return $quoteItem;
}
}
}
}
return $quoteItem;
Expand Down
11 changes: 0 additions & 11 deletions app/code/core/Mage/Sales/Model/Quote/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,6 @@ protected function _construct()
$this->_init('sales/quote_address');
}

/**
* Init mapping array of short fields to its full names
*
* @return $this
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('quote_address');
return $this;
}

/**
* Initialize Quote identifier before save
*
Expand Down
12 changes: 0 additions & 12 deletions app/code/core/Mage/Sales/Model/Quote/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,6 @@ protected function _construct()
$this->_errorInfos = Mage::getModel('sales/status_list');
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = Mage::helper('sales')->getOldFieldMap('quote_item');
return $this;
}

/**
* Quote Item Before Save prepare data process
*
Expand Down
14 changes: 0 additions & 14 deletions app/code/core/Mage/Widget/Model/Widget/Instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,6 @@ protected function _construct()
}
}

/**
* Init mapping array of short fields to
* its full names
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{
$this->_oldFieldsMap = array(
'type' => 'instance_type',
);
return $this;
}

/**
* Processing object before save data
*
Expand Down
30 changes: 0 additions & 30 deletions lib/Varien/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ class Varien_Object implements ArrayAccess
*/
public function __construct()
{
$this->_initOldFieldsMap();
if ($this->_oldFieldsMap) {
$this->_prepareSyncFieldsMap();
}

$args = func_get_args();
if (empty($args[0])) {
$args[0] = array();
Expand All @@ -123,31 +118,6 @@ protected function _addFullNames()
}
}

/**
* Inits mapping array of object's previously used fields to new fields.
* Must be overloaded by descendants to set concrete fields map.
*
* @return Varien_Object
*/
protected function _initOldFieldsMap()
{

}

/**
* Called after old fields are inited. Forms synchronization map to sync old fields and new fields
* between each other.
*
* @return Varien_Object
*/
protected function _prepareSyncFieldsMap()
{
$old2New = $this->_oldFieldsMap;
$new2Old = array_flip($this->_oldFieldsMap);
$this->_syncFieldsMap = array_merge($old2New, $new2Old);
return $this;
}

/**
* Internal constructor not depended on params. Can be used for object initialization
*/
Expand Down

0 comments on commit 40808b6

Please sign in to comment.