Skip to content

Commit eb2d31f

Browse files
ENGCOM-8364: Updated string with Static key. #30579
- Merge Pull Request #30579 from ejaz-alam/magento2:patch-2 - Merged commits: 1. 6970b19 2. fd4a5a7
2 parents 68c903f + fd4a5a7 commit eb2d31f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ class Address extends AbstractAddress implements
139139
const ADDRESS_TYPE_BILLING = 'billing';
140140

141141
const ADDRESS_TYPE_SHIPPING = 'shipping';
142+
143+
private const CACHED_ITEMS_ALL = 'cached_items_all';
142144

143145
/**
144146
* Prefix of model events
@@ -636,8 +638,7 @@ public function getItemsCollection()
636638
public function getAllItems()
637639
{
638640
// We calculate item list once and cache it in three arrays - all items
639-
$key = 'cached_items_all';
640-
if (!$this->hasData($key)) {
641+
if (!$this->hasData(self::CACHED_ITEMS_ALL)) {
641642
$quoteItems = $this->getQuote()->getItemsCollection();
642643
$addressItems = $this->getItemsCollection();
643644

@@ -676,10 +677,10 @@ public function getAllItems()
676677
}
677678

678679
// Cache calculated lists
679-
$this->setData('cached_items_all', $items);
680+
$this->setData(self::CACHED_ITEMS_ALL, $items);
680681
}
681682

682-
$items = $this->getData($key);
683+
$items = $this->getData(self::CACHED_ITEMS_ALL);
683684

684685
return $items;
685686
}

0 commit comments

Comments
 (0)