Skip to content

Commit 448e449

Browse files
committed
fix: php
1 parent 44a9242 commit 448e449

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

playground/php/src/search.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
// }
9090
// var_dump($rules);
9191

92-
$configForIngestion = $config->setFullHosts(['http://localhost:6689'])->setTransformationRegion('eu');
92+
$configForIngestion = $config->setTransformationRegion('eu');
9393

9494
$clientWithTransformation = SearchClient::createWithConfig($configForIngestion);
9595

96-
var_dump($clientWithTransformation->saveObjectsWithTransformation('boyd', [['objectID' => '1', 'name' => 'Michel']], true));
96+
var_dump($clientWithTransformation->replaceAllObjectsWithTransformation('boyd', [['objectID' => '1', 'name' => 'Michel']], true));

templates/php/api.mustache

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
330330
$objects,
331331
$action = 'addObject',
332332
$waitForTasks = true,
333-
$referenceIndexName = null,
334333
$batchSize = 1000,
334+
$referenceIndexName = null,
335335
$requestOptions = []
336336
) {
337337
$responses = [];
@@ -357,17 +357,16 @@ use Algolia\AlgoliaSearch\Exceptions\NotFoundException;
357357
$timeoutCalculation = 'Algolia\AlgoliaSearch\Support\Helpers::linearTimeout';
358358
359359
foreach ($responses as $response) {
360-
$this->waitForTask($indexName, $response['taskID']);
361360
$retry = 0;
362361
363362
while ($retry < 50) {
364363
try {
365-
$resp = $this->getEvent($response->runID, $response->eventID);
364+
$this->getEvent($response["runID"], $response["eventID"]);
366365
367366
break;
368367
} catch (NotFoundException $e) {
369368
if (404 === $e->getCode()) {
370-
return null;
369+
return $responses;
371370
}
372371
}
373372

0 commit comments

Comments
 (0)