Adds more options, overwriting existing options.
@param array $options the options to be added.
@return $this the query object itself
@throws InvalidParamException if $options is not an array
@see options()
@since 2.0.4
779443
public function addOptions($options)
    {
        if (!is_array($options)) {
            throw new InvalidParamException('Array parameter expected, ' . gettype($options) . ' received.');
        }

        $this->options = array_merge($this->options, $options);
        return $this;
    }
749758
public function withOptions(array $options = [])
    {
        $options += [
            'readConcern' => $this->readConcern,
            'readPreference' => $this->readPreference,
            'typeMap' => $this->typeMap,
            'writeConcern' => $this->writeConcern,
        ];

        return new Database($this->manager, $this->databaseName, $options);
    }
266230
protected function setOptions(array $options)
    {
        $this->options = [];

        foreach ($options as $option => $value) {

            if (!in_array($option, (array)$this->availableOptions)) {
                throw new \InvalidArgumentException(
                    sprintf('filter %s has no option "%s"', get_class($this), $option)
                );
            }

            $this->options[$option] = $value;
        }
    }
88637
public function set_options(array $options)
	{
		foreach ($options as $key => $val)
		{
			if (is_string($key) && ! is_numeric($key))
			{
				$key = constant('CURLOPT_' . strtoupper($key));
			}

			$this->options[$key] = $val;
		}

		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;

	}
1077659
public function setOptions(array $options) {
		if(isset($options['data_type']))
			$this->data_type = $options['data_type'];
		if(isset($options['default']))
			$this->value = $options['default'];
		if(isset($options['widget']))
			$this->widget = $options['widget'];

		$this->options = array_merge_recursive($this->options, $options);

		return $this;
	}
772257
public function setOptions($options)
    {
        $options = $this->prepareOptions($options);

        $this->setHost($options['host']);
        $this->setScheme($options['scheme']);
        $this->setPort($options['port']);
        $this->setSslPort($options['sslPort']);
        $this->setRequirements($options['requirements']);
        $this->setExtraValues($options['extra']);

        return $this;
    }
446404
public function withOptions($options)
    {
        if (is_array($options)) {
            $options = new RequestOptions($options);
        }

        $this->options = $options;

        return $this;
    }
123350
public function setOptions(array $options): Options
    {
        foreach ($options as $key => $option) {
            $this->options[$key] = $option;
        }

        return $this;
    }
1168603
public function addOptions(array $options)
    {
        $existingOptions = $this->getOptions();
        $newOptions = empty($existingOptions) ? $options : array_merge((array)$existingOptions, $options);
        $this->setOptions($newOptions);
        return $this;
    }
1102321
public function setOptions($options)
	{
	    if (!is_array($options) && !$options instanceof Traversable) {
	        throw new \InvalidArgumentException(sprintf(
                'Expected an array or Traversable; received "%s"',
                (is_object($options) ? get_class($options) : gettype($options))
	        ));
	    }

	    foreach ($options as $key => $value){

	        $key = strtolower($key);

	        if($key == 'loader'){
	            $this->setLoader($value);
	        }
	    }

	    return $this;
	}
867973
public function setOptions(Array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $this->setTableConfig($optionName, $optionValue);
        }
        return $this;
    }
1210137
public function setOptions(OptionsInterface $options = null)
    {
        if (null !== $options && !$options instanceof Options) {
            $options = new Options($options->toArray());
        }

        $this->options = $options;
        return $this;
    }
82004
public function addOptions($options)
    {
        foreach ($options as $key => $value) {
            $this->addOption($key, $value);
        }

        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;
    }
361601
public function add($argument, array $options = [])
    {
        if (is_array($argument)) {
            $this->addMany($argument);
            return;
        }

        if (is_string($argument)) {
            $argument = Argument::createFromArray($argument, $options);
        }

        if (!$argument instanceof Argument) {
            throw new InvalidArgumentException('Please provide an argument name or object.');
        }

        $this->arguments[$argument->name()] = $argument;
    }
1313212
protected function set_options( array $options ) {
        $this->options = array_merge( $this->options, $options );
        $this->options = (object) $this->options;

        if ( ! is_string( $this->options->instance ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `instance` must be string.' );
        }

        $this->set_namespace();

        if ( ! is_string( $this->options->action ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `action` must be string.' );
        }

        if ( ! is_string( $this->options->domain ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `domain` must be string.' );
        }

        if ( ! is_string( $this->options->lang_dir ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `lang_dir` must be string.' );
        }

        if ( ! is_string( $this->options->lang_path ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `lang_path` must be string.' );
        }

        if ( ! is_string( $this->options->namespace ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `namespace` must be string.' );
        }

        if ( ! is_string( $this->options->src_dir ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `src_dir` must be string.' );
        }

        if ( ! is_array( $this->options->files ) ) {
            throw new InvalidArgumentException( 'Invalid argument. `files` must be array.' );
        }

        $this->options->files = array_filter( $this->options->files, function ( $file ) {
            return is_string( $file ) && file_exists( $this->get_src_path( $file ) );
        } );
    }