Merges the specified options with these ones. Values with same ID will be
replaced.

@param array|OptionsArray $options the options to be merged
193049
public function merge($options)
    {
        if (is_array($options)) {
            $this->options = array_merge_recursive($this->options, $options);
        } elseif ($options instanceof self) {
            $this->options = array_merge_recursive($this->options, $options->options);
        }
    }
566480
protected function _mergeOptions(array $current, array $options)
    {
        if (isset($options['frontend']['name'])) {
            $current['frontend']['name'] = $options['frontend']['name'];
        }
        if (isset($options['backend']['name'])) {
            $current['backend']['name'] = $options['backend']['name'];
        }
        if (isset($options['frontend']['options'])) {
            foreach ($options['frontend']['options'] as $key=>$value) {
                $current['frontend']['options'][$key] = $value;
            }
        }
        if (isset($options['backend']['options'])) {
            foreach ($options['backend']['options'] as $key=>$value) {
                $current['backend']['options'][$key] = $value;
            }
        }
        return $current;
    }
1356180
public function addOptions(array $options) : Select
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
1155948
public function setOptions(array $options, $merge = true)
    {
        $this->options = $merge ? Arr::merge($this->options, $options) : $options;

        return $this;
    }
472708
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->setOption($k, $v);
        }
    }
1235715
public function mergeValuesBase(array $values): void
  {
    if (array_key_exists($this->name, $values))
    {
      $this->setValuesBase($values);
    }
  }
615453
protected function setDefaultOptions(array $options = [])
    {
        $this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
        $this->options = $this->prepareOptions($options);

        $defaults = $this->setDefaultClasses($options);
        $this->options = $this->formHelper->mergeOptions($this->options, $defaults);

        $this->setupLabel();
    }
1356018
public function setOptions(array $options = null): void
    {
        // store options by default
        $this->options = (array)$options;

        // apply options
        foreach ($this->options as $key => $value) {
            $this->setOption($key, $value);
        }
    }
858237
public function update( $options = [] )
    {

        if ( is_null( $this->row ) ) {
            return $this->reset();
        }

        $mergeOptions = array_replace_recursive( $this->_value, $options );

        $result = WpOption::updateOrCreate(
            ['option_name' => $this->optionsName],
            ['option_value' => json_encode( $mergeOptions )]
        );


        $this->_value = (array) $mergeOptions;

        return $result;

    }
607899
protected function init(array $options = array())
    {
        foreach ($options as $key => $value) {
            if (property_exists($this, $key)) {
                $this->{$key} = $value;
            }
        }
    }
106026
public function setOptions($options) 
	{
		foreach ($this->options as $key => $option) {
			if (isset($options[$key])) {
				$this->options[$key] = $options[$key];
			}
		}
	}
1205418
protected function _mergeOptions($options) {
		if (!is_array($options)) {
			$type = $options;
			if (!$type) {
				$type = 'info';
			}
			$options = [
				'type' => $type,
			];
		}

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

		if (isset($options['element']) && !isset($options['type'])) {
			$options['type'] = $options['element'];
		}

		$options += ['type' => 'info'];
		$options += ['element' => $options['type']];

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

		return $options;
	}
925188
public function setOptions(array $options)
    {
        foreach ($options as $opt => $val) {
            $this->setOption($opt, $val);
        }

        return $this;
    }
355407
protected function mergeOptions(array $defaulOptions, array $options = null)
    {
        if (is_null($options)) {
            $options = $defaulOptions;
        }

        foreach ($defaulOptions as $key => $value) {
            if (!isset($options[$key])) {
                $options[$key] = $value;
            }
            if (is_bool($options[$key])) {
                $options[$key] = ($options[$key]) ? 'true' : 'false';
            }
        }

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

        return $this;
    }
124785
public function setOptions(array $options)
    {
        if (isset($options['path']) && is_dir($options['path'])) {
            $this->_path = $options['path'];
        }
        if (isset($options['callback']) && is_callable($options['callback'])) {
            $this->_callback = $options['callback'];
        }
    }
538863
public function initialize(array $options)
    {
        foreach ($options as $optionName => $optionValue) {
            $methodName = 'set' . ucfirst($optionName);
            if (method_exists($this, $methodName)) {
                $this->$methodName($optionValue);
            }
        }
    }