diff --git a/playground/php/src/search.php b/playground/php/src/search.php index 5aa64ecd9a5..e26c4c30dcd 100644 --- a/playground/php/src/search.php +++ b/playground/php/src/search.php @@ -15,6 +15,9 @@ $env['ALGOLIA_ADMIN_KEY'] ); +$config->setMaxRetries(200); +var_dump($config->getDefaultMaxRetries()); + //$config->setFullHosts( // [ // 'http://localhost:6677', diff --git a/templates/php/client_config.mustache b/templates/php/client_config.mustache index e1b326b492b..246ad23f64b 100644 --- a/templates/php/client_config.mustache +++ b/templates/php/client_config.mustache @@ -48,6 +48,20 @@ class {{configClassname}} extends {{#hasRegionalHost}}ConfigWithRegion{{/hasRegi return $this->config['waitTaskTimeBeforeRetry']; } + /** + * Sets the max retries value used in the Search helpers (e.g. replaceAllobjects) + * + * @param number $maxRetries the user agent of the api client + * + * @return $this + */ + public function setMaxRetries($maxRetries) + { + $this->config['defaultMaxRetries'] = $maxRetries; + + return $this; + } + public function getDefaultMaxRetries() { return $this->config['defaultMaxRetries']; @@ -73,4 +87,4 @@ class {{configClassname}} extends {{#hasRegionalHost}}ConfigWithRegion{{/hasRegi {{/isSearchClient}} ]; } -} +} \ No newline at end of file