Skip to content

Commit acc3a2a

Browse files
committed
MAGE-1151: switch from to
1 parent 76dc5ca commit acc3a2a

File tree

14 files changed

+69
-69
lines changed

14 files changed

+69
-69
lines changed

Api/IndexBuilder/IndexBuilderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface IndexBuilderInterface
66
{
7-
public function buildIndex(int $storeId, ?array $ids, ?array $options): void;
7+
public function buildIndex(int $storeId, ?array $entityIds, ?array $options): void;
88

99
public function buildIndexFull(int $storeId, ?array $options): void;
1010
}

Api/IndexBuilder/UpdatableIndexBuilderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
interface UpdatableIndexBuilderInterface extends IndexBuilderInterface
66
{
7-
public function buildIndexList(int $storeId, ?array $ids, ?array $options): void;
7+
public function buildIndexList(int $storeId, ?array $entityIds, ?array $options): void;
88
}

Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function rebuildStoreAdditionalSectionsIndex(int $storeId): void
6060
*/
6161
public function rebuildStorePageIndex($storeId, array $pageIds = null): void
6262
{
63-
$this->pageIndexBuilder->buildIndexFull($storeId, ['ids' => $pageIds]);
63+
$this->pageIndexBuilder->buildIndexFull($storeId, ['entityIds' => $pageIds]);
6464
}
6565

6666
/**

Model/Indexer/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private function rebuildAffectedProducts($storeId)
8787
'buildIndexList',
8888
[
8989
'storeId' => $storeId,
90-
'ids' => $chunk,
90+
'entityIds' => $chunk,
9191
],
9292
count($chunk)
9393
);
@@ -109,7 +109,7 @@ private function processSpecificCategories($categoryIds, $categoriesPerPage, $st
109109
'buildIndexList',
110110
[
111111
'storeId' => $storeId,
112-
'ids' => $chunk,
112+
'entityIds' => $chunk,
113113
],
114114
count($chunk)
115115
);

Model/Indexer/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function execute($ids)
4646
if ($this->isPagesInAdditionalSections($storeId)) {
4747
$data = ['storeId' => $storeId];
4848
if (is_array($ids) && count($ids) > 0) {
49-
$data['options'] = ['ids' => $ids];
49+
$data['options'] = ['entityIds' => $ids];
5050
}
5151

5252
/** @uses PageIndexBuilder::buildIndexFull() */

Model/Indexer/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function execute($productIds)
6262
$this->queue->addToQueue(
6363
ProductIndexBuilder::class,
6464
'buildIndexList',
65-
['storeId' => $storeId, 'ids' => $chunk],
65+
['storeId' => $storeId, 'entityIds' => $chunk],
6666
count($chunk)
6767
);
6868
}
@@ -90,7 +90,7 @@ public function execute($productIds)
9090
$data = [
9191
'storeId' => $storeId,
9292
'options' => [
93-
'productIds' => $productIds,
93+
'entityIds' => $productIds,
9494
'page' => $i,
9595
'pageSize' => $productsPerPage,
9696
'useTmpIndex' => $useTmpIndex,

Model/Job.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function canMerge(Job $job, $maxJobDataSize)
127127
// @todo Remove legacy checks on 3.16.0
128128
if ((!isset($decodedData['product_ids']) || count($decodedData['product_ids']) <= 0)
129129
&& (!isset($decodedData['category_ids']) || count($decodedData['category_ids']) < 0)
130-
&& (!isset($decodedData['ids']) || count($decodedData['ids']) < 0)
130+
&& (!isset($decodedData['entity_ids']) || count($decodedData['entity_ids']) < 0)
131131
&& (!isset($decodedData['page_ids']) || count($decodedData['page_ids']) < 0)) {
132132
return false;
133133
}
@@ -137,7 +137,7 @@ public function canMerge(Job $job, $maxJobDataSize)
137137
// @todo Remove legacy checks on 3.16.0
138138
if ((!isset($candidateDecodedData['product_ids']) || count($candidateDecodedData['product_ids']) <= 0)
139139
&& (!isset($candidateDecodedData['category_ids']) || count($candidateDecodedData['category_ids']) < 0)
140-
&& (!isset($candidateDecodedData['ids']) || count($candidateDecodedData['ids']) < 0)
140+
&& (!isset($candidateDecodedData['entity_ids']) || count($candidateDecodedData['entity_ids']) < 0)
141141
&& (!isset($candidateDecodedData['page_ids']) || count($candidateDecodedData['page_ids']) < 0)) {
142142
return false;
143143
}
@@ -160,8 +160,8 @@ public function canMerge(Job $job, $maxJobDataSize)
160160
return false;
161161
}
162162

163-
if (isset($decodedData['ids'])
164-
&& count($decodedData['ids']) + count($candidateDecodedData['ids']) > $maxJobDataSize) {
163+
if (isset($decodedData['entity_ids'])
164+
&& count($decodedData['entity_ids']) + count($candidateDecodedData['entity_ids']) > $maxJobDataSize) {
165165
return false;
166166
}
167167

@@ -207,13 +207,13 @@ public function merge(Job $mergedJob)
207207
));
208208

209209
$dataSize = count($decodedData['page_ids']);
210-
} elseif (isset($decodedData['ids'])) {
211-
$decodedData['ids'] = array_unique(array_merge(
212-
$decodedData['ids'],
213-
$mergedJobDecodedData['ids']
210+
} elseif (isset($decodedData['entity_ids'])) {
211+
$decodedData['entity_ids'] = array_unique(array_merge(
212+
$decodedData['entity_ids'],
213+
$mergedJobDecodedData['entity_ids']
214214
));
215215

216-
$dataSize = count($decodedData['ids']);
216+
$dataSize = count($decodedData['entity_ids']);
217217
}
218218

219219
$this->setDecodedData($decodedData);

Service/AdditionalSection/IndexBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public function buildIndexFull(int $storeId, array $options = null): void
4343

4444
/**
4545
* @param int $storeId
46-
* @param array|null $ids
46+
* @param array|null $entityIds
4747
* @param array|null $options
4848
* @return void
4949
* @throws AlgoliaException
5050
* @throws ExceededRetriesException
5151
* @throws NoSuchEntityException
5252
*/
53-
public function buildIndex(int $storeId, ?array $ids, ?array $options): void
53+
public function buildIndex(int $storeId, ?array $entityIds, ?array $options): void
5454
{
5555
if ($this->isIndexingEnabled($storeId) === false) {
5656
return;

Service/Category/IndexBuilder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,36 @@ public function buildIndexFull(int $storeId, array $options = null): void
4444

4545
/**
4646
* @param int $storeId
47-
* @param array|null $ids
47+
* @param array|null $entityIds
4848
* @param array|null $options
4949
* @return void
5050
* @throws AlgoliaException
5151
* @throws LocalizedException
5252
* @throws NoSuchEntityException
5353
*/
54-
public function buildIndexList(int $storeId, array $ids = null, array $options = null): void
54+
public function buildIndexList(int $storeId, array $entityIds = null, array $options = null): void
5555
{
56-
$this->buildIndex($storeId, $ids, $options);
56+
$this->buildIndex($storeId, $entityIds, $options);
5757
}
5858

5959
/**
6060
* @param int $storeId
61-
* @param array|null $ids
61+
* @param array|null $entityIds
6262
* @param array|null $options
6363
* @return void
6464
* @throws AlgoliaException
6565
* @throws LocalizedException
6666
* @throws NoSuchEntityException
6767
* @throws \Exception
6868
*/
69-
public function buildIndex(int $storeId, ?array $ids, ?array $options): void
69+
public function buildIndex(int $storeId, ?array $entityIds, ?array $options): void
7070
{
7171
if ($this->isIndexingEnabled($storeId) === false) {
7272
return;
7373
}
7474

75-
if (!is_null($ids)) {
76-
$this->rebuildEntityIds($storeId, $ids);
75+
if (!is_null($entityIds)) {
76+
$this->rebuildEntityIds($storeId, $entityIds);
7777
return;
7878
}
7979

Service/Page/IndexBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ public function __construct(
3838
*/
3939
public function buildIndexFull(int $storeId, array $options = null): void
4040
{
41-
$this->buildIndex($storeId, $options['ids'] ?? null, null);
41+
$this->buildIndex($storeId, $options['entityIds'] ?? null, null);
4242
}
4343

4444
/**
4545
* @param $storeId
46-
* @param array|null $ids
46+
* @param array|null $entityIds
4747
* @param array|null $options
4848
* @return void
4949
* @throws AlgoliaException
5050
* @throws ExceededRetriesException
5151
* @throws NoSuchEntityException
5252
*/
53-
public function buildIndex($storeId, ?array $ids, ?array $options): void
53+
public function buildIndex($storeId, ?array $entityIds, ?array $options): void
5454
{
5555
if ($this->isIndexingEnabled($storeId) === false) {
5656
return;
@@ -67,12 +67,12 @@ public function buildIndex($storeId, ?array $ids, ?array $options): void
6767

6868
$this->startEmulation($storeId);
6969

70-
$pages = $this->pageHelper->getPages($storeId, $ids);
70+
$pages = $this->pageHelper->getPages($storeId, $entityIds);
7171

7272
$this->stopEmulation();
7373

7474
// if there are pageIds defined, do not index to _tmp
75-
$isFullReindex = (!$ids);
75+
$isFullReindex = (!$entityIds);
7676

7777
if (isset($pages['toIndex']) && count($pages['toIndex'])) {
7878
$pagesToIndex = $pages['toIndex'];

0 commit comments

Comments
 (0)