Elastica\Connection::getConfig PHP Метод

getConfig() публичный Метод

Returns a specific config key or the whole config array if not set.
public getConfig ( string $key = '' ) : array | string
$key string Config key
Результат array | string Config value
    public function getConfig($key = '')
    {
        $config = $this->getParam('config');
        if (empty($key)) {
            return $config;
        }
        if (!array_key_exists($key, $config)) {
            throw new InvalidException('Config key is not set: ' . $key);
        }
        return $config[$key];
    }

Usage Example

Пример #1
0
 /**
  * @group unit
  * @expectedException \Elastica\Exception\InvalidException
  */
 public function testGetConfigInvalidValue()
 {
     $connection = new Connection();
     $connection->getConfig('url');
 }
All Usage Examples Of Elastica\Connection::getConfig