AlgoliaSearch\Index::getObjects PHP Method

getObjects() public method

Get several objects from this index.
public getObjects ( array $objectIDs ) : mixed
$objectIDs array the array of unique identifier of objects to retrieve
return mixed
    public function getObjects($objectIDs)
    {
        if ($objectIDs == null) {
            throw new \Exception('No list of objectID provided');
        }
        $requests = array();
        foreach ($objectIDs as $object) {
            $req = array('indexName' => $this->indexName, 'objectID' => $object);
            array_push($requests, $req);
        }
        return $this->client->request($this->context, 'POST', '/1/indexes/*/objects', array(), array('requests' => $requests), $this->context->readHostsArray, $this->context->connectTimeout, $this->context->readTimeout);
    }