@param array $options

@return $this
774202
protected function connect(array $options = [])
    {
        $this->client->connect($options);

        if (!$this->client->connected) {
            $message   = $this->client->connect_error ?: $this->client->error;
            $errorCode = $this->client->connect_errno ?: $this->client->errno;

            throw new PDOException($message, $errorCode);
        }

        return $this;
    }
585793
public function setOptions(array $options)
    {
        if ($this->options && is_array($options)) {
            $options = ArrayUtils::merge($this->options, $options);
        }

        $this->options = $options;

        return $this;
    }
209517
public function addOptions(array $options) : Getopt
    {
        if (!empty($this->options)){
            $this->options = array_merge($this->options, $options);
        }
        else{
            $this->options = $options;
        }
        return $this;
    }
550632
public function addOptions(array $options)
    {
        foreach ($options as $name => $defaultValue) {
            $this->addOption($name, $defaultValue);
        }

        return $this;
    }
539623
public function options(array $options): self
    {
        foreach ($options as $name => $value) {
            $this->option($name, $value);
        }

        return $this;
    }
261773
public function createOptions(Array $options) {

		$this->options = [];

		foreach($options as $k => $v) {
			$this->appendOption(new SelectOptionElement($k, $v, $this));
		}

		$this->setValue();

		return $this;

	}
108258
public function setOptions($options)
    {
        if ($options instanceof \Traversable) {
            $options = iterator_to_array($options);
        }

        if (is_object($options)) {
            $options = get_object_vars($options);
        }

        $this->options = (array) $options;

        return $this;
    }
940849
public function createOptions(Array $options) {

		$this->options = [];

		foreach($options as $value => $label) {
			$this->appendOption(new RadioOptionElement($value, new LabelElement($label)));
		}
		
		return $this;

	}
164411
protected function _setDefaultUserOptions(array $options) {
    foreach ($options as $option=>$value) {
      if (!$this->getUserOption($option))
        $this->setUserOption($option,$value);
    }
    return $this;
  }
76627
public function setOptions($options)
    {
        if ($this->options !== $options) {
            if (!$options instanceof AdapterOptions) {
                $options = new AdapterOptions($options);
            }

            if ($this->options) {
                $this->options->setAdapter(null);
            }
            $options->setAdapter($this);
            $this->options = $options;
        }

        return $this;
    }
694779
public function options(array $options): self
    {
        foreach ($options as $key => $value) {
            $this->set('options.'.$key, $value);
        }

        return $this;
    }
1191818
public function setOptions(array $options)
    {
        foreach ($options as $key => $value) {
            if (in_array(strtolower($key), $this->_skipOptions)) {
                continue;
            }

            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }

        return $this;
    }
413042
public function set($options)
    {
        $this->__opts__ = $this->assign($this->__opts__, $options);
        return $this;
    }
955978
public function addOptions(array $options) : OptionGroup
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
430776
final public function curlSetOptArray(array $options = array())
	{
		$this->curlFilterOpts($options);
		curl_setopt_array($this->curl_handle, $options);
		return $this;
	}
1195659
public function setOptions($options = [])
    {
        $this->options = $options;
        $this->debug->info(__FUNCTION__, 'setOptions: ', $this->options);

        return $this;
    }
115300
public function setOptions($options)
    {
        if (!is_array($options) && !$options instanceof \Traversable) {
            throw new \InvalidArgumentException(sprintf(
                    'Parameter provided to %s must be an array or Traversable',
                    __METHOD__
            ));
        }
    
        foreach ($options as $key => $value){
            $this->setOption($key, $value);
        }
         
        return $this;
    }