Skip to content

Commit ac5427b

Browse files
igrybkovValeriy Nayda
authored andcommitted
MAGETWO-65099: [Performance] Optimize validation of swatches attributes
- Fix phpdocs and method naming
1 parent 358a304 commit ac5427b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/code/Magento/Swatches/Model/SwatchAttributeCodes.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getCodes()
7272
if ($this->swatchAttributeCodes === null) {
7373
$swatchAttributeCodesCache = $this->cache->load($this->cacheKey);
7474
if (false === $swatchAttributeCodesCache) {
75-
$swatchAttributeCodes = $this->loadSwatchAttributeCodes();
75+
$swatchAttributeCodes = $this->getSwatchAttributeCodes();
7676
$this->cache->save(json_encode($swatchAttributeCodes), $this->cacheKey, $this->cacheTags);
7777
} else {
7878
$swatchAttributeCodes = json_decode($swatchAttributeCodesCache, true);
@@ -86,9 +86,11 @@ public function getCodes()
8686
/**
8787
* Returns list of known swatch attributes.
8888
*
89+
* Returns a map of id and code for all EAV attributes with swatches
90+
*
8991
* @return array
9092
*/
91-
private function loadSwatchAttributeCodes()
93+
private function getSwatchAttributeCodes()
9294
{
9395
$select = $this->resourceConnection->getConnection()->select()
9496
->from(
@@ -108,6 +110,8 @@ private function loadSwatchAttributeCodes()
108110
/**
109111
* Returns Select for attributes Ids.
110112
*
113+
* Builds a "Select" object which loads all EAV attributes that has "swatch" options
114+
*
111115
* @return Select
112116
*/
113117
private function getAttributeIdsSelect()

0 commit comments

Comments
 (0)