AlgoliaSearch\Client::listIndexes PHP Метод

listIndexes() публичный метод

List all existing indexes return an object in the form: array( "items" => array( array("name" => "contacts", "createdAt" => "2013-01-18T15:33:13.556Z"), array("name" => "notes", "createdAt" => "2013-01-18T15:33:13.556Z") ) ).
public listIndexes ( ) : mixed
Результат mixed
    public function listIndexes()
    {
        return $this->request($this->context, 'GET', '/1/indexes/', null, null, $this->context->readHostsArray, $this->context->connectTimeout, $this->context->readTimeout);
    }

Usage Example

Пример #1
0
 /**
  * Index Exists.
  *
  * Does this index exist?
  *
  * @return bool
  */
 public function indexExists()
 {
     foreach (Arr::get($this->client->listIndexes(), 'items', []) as $index) {
         if ($index['name'] == $this->getConfigurator()->index()) {
             return true;
         }
     }
     return false;
 }
All Usage Examples Of AlgoliaSearch\Client::listIndexes