Provide a set of options with keys you can rely on.

@param array|Garp_Util_Configuration $options
@return void
779978
public static function _normalizeOptionsForUnrelate(&$options) {
        $options = ($options instanceof Garp_Util_Configuration) ? $options :
            new Garp_Util_Configuration($options);
        $options->obligate('modelA')
            ->obligate('modelB')
            ->setDefault('keyA', null)
            ->setDefault('keyB', null)
            ->setDefault('rule', null)
            ->setDefault('ruleA', null)
            ->setDefault('ruleB', null)
            ->setDefault('bindingModel', null)
            ->setDefault('bidirectional', true);
        if (!$options['keyA'] && !$options['keyB']) {
            throw new Garp_Content_Relation_Exception(static::EXCEPTION_MISSING_KEYS);
        }

        // use models, not class names
        if (is_string($options['modelA'])) {
            $options['modelA'] = new $options['modelA']();
        }
        if (is_string($options['modelB'])) {
            $options['modelB'] = new $options['modelB']();
        }
        if (is_string($options['bindingModel'])) {
            $options['bindingModel'] = new $options['bindingModel']();
        }
        // Important to collect fresh data
        $options['modelA']->setCacheQueries(false);
        $options['modelB']->setCacheQueries(false);

        $options['keyA'] = (array)$options['keyA'];
        $options['keyB'] = (array)$options['keyB'];

        // allow 'rule' key to be set when 'ruleA' is meant
        if ($options['rule'] && !$options['ruleA']) {
            $options['ruleA'] = $options['rule'];
            // also allow it the other way around
        } else if ($options['ruleA'] && !$options['rule']) {
            $options['rule'] = $options['ruleA'];
        }
    }
1168720
public function setOptions($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        $this->options = array_merge($this->getDefaults(), $options);
        return $this;
    }
118408
static public function setOptions($options = [])
    {
        if (isset($options['gzip'])) {
            self::$optGzip = !empty($options['gzip']);
        }
        if (isset($options['minimal'])) {
            self::$optMinimal = !empty($options['minimal']);
        }
    }
520528
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->_options[$k] = $v;
        }
        return $this;
    }
1119728
private function _setKeysFromConfig($options) {
        $params = \Zend_Registry::get('recaptcha');
        if (!empty($params['sitekey'])) {
            $options['siteKey'] = $params['sitekey'];
        }
        if (!empty($params['secretkey'])) {
            $options['secretKey'] = $params['secretkey'];
        }
        return $options;
    }
485460
protected static function _setupOptions(&$options)
    {
        $options = self::_merge(self::$_defaults, $options);
        foreach ($options['children'] as &$child) {
            self::_setupOptions($child);
        }
    }
616677
public function setOptions(array $options): void
    {
        if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) {
            return;
        }
        $validOptions = array_flip([
            'cache_limiter', 'cache_expire', 'cookie_domain', 'cookie_httponly',
            'cookie_lifetime', 'cookie_path', 'cookie_secure',
            'gc_divisor', 'gc_maxlifetime', 'gc_probability', 'auto_start',
            'lazy_write', 'name', 'referer_check', 'save_path', 'save_handler',
            'serialize_handler', 'use_strict_mode', 'use_cookies',
            'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled',
            'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name',
            'upload_progress.freq', 'upload_progress.min_freq',
            'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags',
        ]);
        foreach ($options as $key => $value) {
            if (isset($validOptions[$key])) {
                ini_set('session.' . $key, (string) $value);
            }
        }
    }
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);
        }
    }
1025974
protected function configure(array $options): void
    {
        $options = array_merge([
            'socket_class' => ClientSocket::class,
            'on_data_callback' => null,
            'socket_options' => [],
        ], $options);

        parent::configure($options);
    }
149356
public function setOptions( array $options )
    {
        foreach ( $this->defaults as $option => $defaults ) {
            $this->values[$option] = ( array_key_exists($defaults['name'], $options) ) ? $options[$option] : $defaults['default'];
        }
    }
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'];
        }
    }
1097717
public function _init($options)
    {
		if(is_array($options)) {
			foreach($options as $opt_name => $opt_val) {
				if(property_exists($this, $opt_name)) {
					$this->$opt_name = $opt_val;
				}
			}
		}
    }
195005
protected function set_options( array $options = [ ] ) {

		foreach ( $options as $key => $value ) {
			if ( ! array_key_exists( $key, $this->options ) ) {
				throw new \InvalidArgumentException(
					sprintf( 'The option "%1$s" does not have a matching option[%1$s] array key', $key ),
					1.0
				);
				continue;
			}

			$this->options[ $key ] = $value;
		}
	}
607899
protected function init(array $options = array())
    {
        foreach ($options as $key => $value) {
            if (property_exists($this, $key)) {
                $this->{$key} = $value;
            }
        }
    }
1228338
protected function initializeOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
1186496
public function setOptions(array $options)
    {
        $availableOptions = [
            'default',
            'group',
            'key',
            'message',
            'messages',
            'rules'
        ];

        foreach ($availableOptions as $option) {
            if (isset($options[$option])) {
                $this->$option = $options[$option];
            }
        }
    }
1060574
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->smarty->$k = $v;
        }
    }