src/ElasticSearch/Mapping.php
public function config($key, $value = null) {
        if (is_array($key))
            $this->config = $key + $this->config;
        else {
            if ($value !== null) $this->config[$key] = $value;
            if (!isset($this->config[$key]))
                throw new \Exception("Configuration key `type` is not set");
            return $this->config[$key];
        }
    }
public function config($key, $value = null) {
        if (is_array($key))
            $this->config = $key + $this->config;
        else {
            if ($value !== null) $this->config[$key] = $value;
            if (!isset($this->config[$key]))
                throw new \Exception("Configuration key `type` is not set");
            return $this->config[$key];
        }
    }
Get or set a config

@param string $key
@param mixed $value
@throws \Exception
@return array|void