Skip to content

Commit bf41dfc

Browse files
committed
MAGE-1095: renaming of the methods as per suggestions
1 parent ef00cca commit bf41dfc

File tree

14 files changed

+47
-47
lines changed

14 files changed

+47
-47
lines changed

Controller/Adminhtml/Reindex/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected function checkAndReindex($product, $stores)
199199
$productIds = [$product->getId()];
200200
$productIds = array_merge($productIds, $this->productHelper->getParentProductIds($productIds));
201201

202-
$this->productIndexBuilder->rebuildIndexIds($storeId, $productIds);
202+
$this->productIndexBuilder->rebuildEntityIds($storeId, $productIds);
203203
$this->messageManager->addSuccessMessage(
204204
__(
205205
'The Product "%1" (%2) has been reindexed for store "%3 / %4 / %5".',

Helper/Data.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public function __construct(
4141
* @throws \Exception
4242
*
4343
* @deprecated
44-
* Use Algolia\AlgoliaSearch\Service\AdditionalSection\IndexBuilder::rebuildIndex() instead
44+
* Use Algolia\AlgoliaSearch\Service\AdditionalSection\IndexBuilder::buildIndex() instead
4545
*/
4646
public function rebuildStoreAdditionalSectionsIndex(int $storeId): void
4747
{
48-
$this->additionalSectionIndexBuilder->rebuildIndex($storeId);
48+
$this->additionalSectionIndexBuilder->buildIndex($storeId);
4949
}
5050

5151
/**
@@ -56,11 +56,11 @@ public function rebuildStoreAdditionalSectionsIndex(int $storeId): void
5656
* @throws NoSuchEntityException
5757
*
5858
* @deprecated
59-
* Use Algolia\AlgoliaSearch\Service\Page\IndexBuilder::rebuildIndex() instead
59+
* Use Algolia\AlgoliaSearch\Service\Page\IndexBuilder::buildIndex() instead
6060
*/
6161
public function rebuildStorePageIndex($storeId, array $pageIds = null): void
6262
{
63-
$this->pageIndexBuilder->rebuildIndex($storeId, $pageIds);
63+
$this->pageIndexBuilder->buildIndex($storeId, $pageIds);
6464
}
6565

6666
/**
@@ -71,11 +71,11 @@ public function rebuildStorePageIndex($storeId, array $pageIds = null): void
7171
* @throws NoSuchEntityException
7272
*
7373
* @deprecated
74-
* Use Algolia\AlgoliaSearch\Service\Category\IndexBuilder::rebuildIndexIds() instead
74+
* Use Algolia\AlgoliaSearch\Service\Category\IndexBuilder::rebuildEntityIds() instead
7575
*/
7676
public function rebuildStoreCategoryIndex($storeId, $categoryIds = null): void
7777
{
78-
$this->categoryIndexBuilder->rebuildIndexIds($storeId, $categoryIds);
78+
$this->categoryIndexBuilder->rebuildEntityIds($storeId, $categoryIds);
7979
}
8080

8181
/**
@@ -86,11 +86,11 @@ public function rebuildStoreCategoryIndex($storeId, $categoryIds = null): void
8686
* @throws NoSuchEntityException
8787
*
8888
* @deprecated
89-
* Use Algolia\AlgoliaSearch\Service\Suggestion:\IndexBuilder:rebuildIndex() instead
89+
* Use Algolia\AlgoliaSearch\Service\Suggestion:\IndexBuilder:buildIndex() instead
9090
*/
9191
public function rebuildStoreSuggestionIndex(int $storeId): void
9292
{
93-
$this->suggestionIndexBuilder->rebuildIndex($storeId);
93+
$this->suggestionIndexBuilder->buildIndex($storeId);
9494
}
9595

9696
/**
@@ -100,11 +100,11 @@ public function rebuildStoreSuggestionIndex(int $storeId): void
100100
* @throws \Exception
101101
*
102102
* @deprecated
103-
* Use Algolia\AlgoliaSearch\Service\Product\IndexBuilder::rebuildIndexIds() instead
103+
* Use Algolia\AlgoliaSearch\Service\Product\IndexBuilder::rebuildEntityIds() instead
104104
*/
105105
public function rebuildStoreProductIndex(int $storeId, array $productIds): void
106106
{
107-
$this->productIndexBuilder->rebuildIndexIds($storeId, $productIds);
107+
$this->productIndexBuilder->rebuildEntityIds($storeId, $productIds);
108108
}
109109

110110
/**
@@ -117,11 +117,11 @@ public function rebuildStoreProductIndex(int $storeId, array $productIds): void
117117
* @throws \Exception
118118
*
119119
* @deprecated
120-
* Use Algolia\AlgoliaSearch\Service\Product\IndexBuilder::rebuildIndex() instead
120+
* Use Algolia\AlgoliaSearch\Service\Product\IndexBuilder::buildIndex() instead
121121
*/
122122
public function rebuildProductIndex(int $storeId, ?array $productIds, int $page, int $pageSize, bool $useTmpIndex): void
123123
{
124-
$this->productIndexBuilder->rebuildIndex($storeId, $productIds, $page, $pageSize, $useTmpIndex);
124+
$this->productIndexBuilder->buildIndex($storeId, $productIds, $page, $pageSize, $useTmpIndex);
125125
}
126126

127127
/**
@@ -134,11 +134,11 @@ public function rebuildProductIndex(int $storeId, ?array $productIds, int $page,
134134
* @throws \Exception
135135
*
136136
* @deprecated
137-
* Use Algolia\AlgoliaSearch\Service\Category\IndexBuilder::rebuildIndex() instead
137+
* Use Algolia\AlgoliaSearch\Service\Category\IndexBuilder::buildIndex() instead
138138
*/
139139
public function rebuildCategoryIndex(int $storeId, int $page, int $pageSize): void
140140
{
141-
$this->categoryIndexBuilder->rebuildIndex($storeId, $page, $pageSize);
141+
$this->categoryIndexBuilder->buildIndex($storeId, $page, $pageSize);
142142
}
143143

144144
/**

Model/Indexer/AdditionalSection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public function executeFull()
4040
return;
4141
}
4242

43-
/** @uses AdditionalSectionIndexBuilder::rebuildIndex() */
43+
/** @uses AdditionalSectionIndexBuilder::buildIndex() */
4444
$this->queue->addToQueue(
4545
AdditionalSectionIndexBuilder::class,
46-
'rebuildIndex',
46+
'buildIndex',
4747
['storeId' => $storeId],
4848
1
4949
);

Model/Indexer/Category.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ private function rebuildAffectedProducts($storeId)
8181
if ($affectedProductsCount > 0 && $this->configHelper->indexProductOnCategoryProductsUpdate($storeId)) {
8282
$productsPerPage = $this->configHelper->getNumberOfElementByPage();
8383
foreach (array_chunk($affectedProducts, $productsPerPage) as $chunk) {
84-
/** @uses ProductIndexBuilder::rebuildIndexIds() */
84+
/** @uses ProductIndexBuilder::rebuildEntityIds() */
8585
$this->queue->addToQueue(
8686
ProductIndexBuilder::class,
87-
'rebuildIndexIds',
87+
'rebuildEntityIds',
8888
[
8989
'storeId' => $storeId,
9090
'productIds' => $chunk,
@@ -103,10 +103,10 @@ private function rebuildAffectedProducts($storeId)
103103
private function processSpecificCategories($categoryIds, $categoriesPerPage, $storeId)
104104
{
105105
foreach (array_chunk($categoryIds, $categoriesPerPage) as $chunk) {
106-
/** @uses CategoryIndexBuilder::rebuildIndexIds */
106+
/** @uses CategoryIndexBuilder::rebuildEntityIds */
107107
$this->queue->addToQueue(
108108
CategoryIndexBuilder::class,
109-
'rebuildIndexIds',
109+
'rebuildEntityIds',
110110
[
111111
'storeId' => $storeId,
112112
'categoryIds' => $chunk,
@@ -140,8 +140,8 @@ private function processFullReindex($storeId, $categoriesPerPage)
140140
'pageSize' => $categoriesPerPage,
141141
];
142142

143-
/** @uses CategoryIndexBuilder::rebuildIndex() */
144-
$this->queue->addToQueue(CategoryIndexBuilder::class, 'rebuildIndex', $data, $categoriesPerPage, true);
143+
/** @uses CategoryIndexBuilder::buildIndex() */
144+
$this->queue->addToQueue(CategoryIndexBuilder::class, 'buildIndex', $data, $categoriesPerPage, true);
145145
}
146146
}
147147
}

Model/Indexer/Page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function execute($ids)
4949
$data['pageIds'] = $ids;
5050
}
5151

52-
/** @uses PageIndexBuilder::rebuildIndex() */
52+
/** @uses PageIndexBuilder::buildIndex() */
5353
$this->queue->addToQueue(
5454
PageIndexBuilder::class,
55-
'rebuildIndex',
55+
'buildIndex',
5656
$data,
5757
is_array($ids) ? count($ids) : 1
5858
);

Model/Indexer/Product.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public function execute($productIds)
5858

5959
if (is_array($productIds) && count($productIds) > 0) {
6060
foreach (array_chunk($productIds, $productsPerPage) as $chunk) {
61-
/** @uses ProductIndexBuilder::rebuildIndexIds() */
61+
/** @uses ProductIndexBuilder::rebuildEntityIds() */
6262
$this->queue->addToQueue(
6363
ProductIndexBuilder::class,
64-
'rebuildIndexIds',
64+
'rebuildEntityIds',
6565
['storeId' => $storeId, 'productIds' => $chunk],
6666
count($chunk)
6767
);
@@ -95,10 +95,10 @@ public function execute($productIds)
9595
'useTmpIndex' => $useTmpIndex,
9696
];
9797

98-
/** @uses ProductIndexBuilder::rebuildIndex() */
98+
/** @uses ProductIndexBuilder::buildIndex() */
9999
$this->queue->addToQueue(
100100
ProductIndexBuilder::class,
101-
'rebuildIndex',
101+
'buildIndex',
102102
$data,
103103
$productsPerPage,
104104
true

Model/Indexer/Suggestion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public function executeFull()
4343
return;
4444
}
4545

46-
/** @uses SuggestionIndexBuilder::rebuildIndex() */
46+
/** @uses SuggestionIndexBuilder::buildIndex() */
4747
$this->queue->addToQueue(
4848
SuggestionIndexBuilder::class,
49-
'rebuildIndex',
49+
'buildIndex',
5050
['storeId' => $storeId],
5151
1
5252
);

Model/Source/JobMethods.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class JobMethods implements \Magento\Framework\Data\OptionSourceInterface
77
private $methods = [
88
'saveConfigurationToAlgolia' => 'Save Configuration',
99
'moveIndexWithSetSettings' => 'Move Index',
10-
'rebuildIndex' => 'Rebuild Full Index',
11-
'rebuildIndexIds' => 'Rebuild Specific IDs',
10+
'buildIndex' => 'Build Full Index',
11+
'rebuildEntityIds' => 'Update Index',
1212
'deleteInactiveProducts' => 'Delete Inactive Products',
1313
// @deprecated
1414
'deleteObjects' => 'Object deletion (deprecated)',

Service/AdditionalSection/IndexBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(
3535
* @throws NoSuchEntityException
3636
* @throws \Exception
3737
*/
38-
public function rebuildIndex(int $storeId): void
38+
public function buildIndex(int $storeId): void
3939
{
4040
if ($this->isIndexingEnabled($storeId) === false) {
4141
return;

Service/Category/IndexBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function __construct(
3737
* @throws NoSuchEntityException
3838
* @throws \Exception
3939
*/
40-
public function rebuildIndex(int $storeId, int $page, int $pageSize): void
40+
public function buildIndex(int $storeId, int $page, int $pageSize): void
4141
{
4242
if ($this->isIndexingEnabled($storeId) === false) {
4343
return;
4444
}
4545

4646
$this->startEmulation($storeId);
4747
$collection = $this->categoryHelper->getCategoryCollectionQuery($storeId, null);
48-
$this->rebuildIndexPage($storeId, $collection, $page, $pageSize);
48+
$this->buildIndexPage($storeId, $collection, $page, $pageSize);
4949
$this->stopEmulation();
5050
}
5151

@@ -57,7 +57,7 @@ public function rebuildIndex(int $storeId, int $page, int $pageSize): void
5757
* @throws NoSuchEntityException
5858
* @throws \Exception
5959
*/
60-
public function rebuildIndexIds($storeId, $categoryIds = null): void
60+
public function rebuildEntityIds($storeId, $categoryIds = null): void
6161
{
6262
if ($this->isIndexingEnabled($storeId) === false) {
6363
return;
@@ -77,7 +77,7 @@ public function rebuildIndexIds($storeId, $categoryIds = null): void
7777
$pages = ceil($size / $this->configHelper->getNumberOfElementByPage());
7878
$page = 1;
7979
while ($page <= $pages) {
80-
$this->rebuildIndexPage(
80+
$this->buildIndexPage(
8181
$storeId,
8282
$collection,
8383
$page,
@@ -99,7 +99,7 @@ public function rebuildIndexIds($storeId, $categoryIds = null): void
9999
* @throws NoSuchEntityException
100100
* @throws AlgoliaException|LocalizedException
101101
*/
102-
protected function rebuildIndexPage($storeId, $collection, $page, $pageSize, $categoryIds = null): void
102+
protected function buildIndexPage($storeId, $collection, $page, $pageSize, $categoryIds = null): void
103103
{
104104
if ($this->isIndexingEnabled($storeId) === false) {
105105
return;

0 commit comments

Comments
 (0)