@param array $options Options

@return ParameterModel
490784
public function setOptions(array $options)
    {
        $this->validateOptions($options, $this->type);

        $this->options = $options;

        return $this;
    }
588833
private function contextToOptions(array $options)
    {
        $optionToBitMap = [
            self::OPTION_OBJECT                    => Yaml::DUMP_OBJECT,
            self::OPTION_EXCEPTION_ON_INVALID_TYPE => Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE,
            self::OPTION_OBJECT_FOR_MAP            => Yaml::DUMP_OBJECT_AS_MAP,
            self::OPTION_MULTI_LINE_LITERAL_BLOCK  => Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK,
        ];

        $bitMaskedOption = 0;

        foreach ($optionToBitMap as $option => $bitMask) {
            if ($options[ $option ]) {
                $bitMaskedOption = $bitMaskedOption | $bitMask;
            }
        }

        return $bitMaskedOption;
    }
494128
public function resolveOptions(array $options)
    {
        $resolver = new OptionsResolver();
    
        $resolver->setRequired(array(
            'search', 'filters', 'page', 'orderBy', 'sort', 'records', 'masterGridRowId'
        ));
    
        $resolver->setAllowedTypes(array(
            'page' => array('int'),
            'orderBy' => array('string', 'bool'),
            'sort' => array('string'),
            'records' => array('int'),
            'search' => array('bool'),
            'filters' => array('array', 'bool'),
            'masterGridRowId' => array('int')
        ));
    
        $resolver->setAllowedValues(array(
            'sort' => array('ASC', 'DESC')
        ));
    
        $resolver->setDefaults(array(
            'search'          => false,
            'filters'         => false,
            'page'            => 0,
            'orderBy'         => false,
            'sort'            => 'ASC',
            'records'         => 0,
            'masterGridRowId' => 0
        ));
    
        $this->options = $resolver->resolve($options);
        
        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;

	}
1049001
private function prepareOptions(array $options){
        if (!Arr::has($options, 'method')) {
            Arr::set($options, 'method', 'post');
        }

        if (!Arr::has($options, 'action')) {
            Arr::set($options, 'action', '');
        }

        return $options;
    }
566716
public function options($options)
    {
        if (!is_array($options)) {
            throw new InvalidParamException('Array parameter expected, ' . gettype($options) . ' received.');
        }

        $this->options = $options;
        return $this;
    }
1023168
public function setOptions($options)
        {
            if(!is_array($options)) {
                throw new \Thin\Exception(get_class() . ": " . __METHOD__ . " expects an array as parametre, " . gettype($options) . " given.");
            }

            foreach($options as $option => $value) {
                $this->setOption($option, $value);
            }

            return $this;
        }
1247308
protected function transformOptions(array $options)
    {
        $phantomOptions = new Options();

        $phantomOptions->setHeaderContent($this->headerHtml);
        $phantomOptions->setFooterContent($this->footerHtml);

        foreach ($options as $optionName => $optionValue) {
            $setterFunction = 'set' . $optionName;
            if (method_exists($phantomOptions, $setterFunction)) {
                $phantomOptions->$setterFunction($optionValue);
            }
        }

        return $phantomOptions;
    }
281492
protected function configureLogOptions(array $options = [])
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'enabled'    => false,
            'level'      => LogLevel::DEBUG,
            'handler'    => null,
            'subscriber' => null,
            'path'       => sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php-tmdb-api.log',
        ]);

        $resolver->setRequired([
            'enabled',
            'level',
            'handler',
        ]);

        $resolver->setAllowedTypes('enabled', ['bool']);
        $resolver->setAllowedTypes('level', ['string']);
        $resolver->setAllowedTypes('handler', ['object', 'null']);
        $resolver->setAllowedTypes('path', ['string', 'null']);
        $resolver->setAllowedTypes('subscriber', ['object', 'null']);

        $options = $resolver->resolve(array_key_exists('log', $options) ? $options['log'] : []);

        if ($options['enabled'] && !$options['handler']) {
            $options['handler'] = new StreamHandler(
                $options['path'],
                $options['level']
            );
        }

        return $options;
    }
905730
public function collection(array $options = []) : \Object\Collection {
		if (!empty($this->virtual_class_name)) {
			$options['model'] = $this->virtual_class_name;
			return \Object\Collection::collectionToModel($options);
		} else {
			return self::collectionStatic($options);
		}
	}
470571
public function options(array $options = [])
    {
        $request = $this->_View->getRequest();

        if (!empty($options['paging'])) {
            $request = $request->withParam(
                'paging',
                $options['paging'] + $request->getParam('paging', [])
            );
            unset($options['paging']);
        }

        $model = $this->defaultModel();
        if (!empty($options[$model])) {
            $request = $request->withParam(
                'paging.' . $model,
                $options[$model] + (array)$request->getParam('paging.' . $model, [])
            );
            unset($options[$model]);
        }

        $this->_View->setRequest($request);

        $this->_config['options'] = array_filter($options + $this->_config['options']);
        if (empty($this->_config['options']['url'])) {
            $this->_config['options']['url'] = [];
        }
        if (!empty($this->_config['options']['model'])) {
            $this->defaultModel($this->_config['options']['model']);
        }
    }
955978
public function addOptions(array $options) : OptionGroup
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
1201749
public function setOptions(array $options): FieldTypeInterface
    {
        $l10n = $this->handleLocalization($options);

        $options = array_merge(
            $this->getDefaultOptions(),
            $this->options,
            $options
        );

        if (isset($options['l10n']) && ! empty($l10n)) {
            $options['l10n'] = array_merge($options['l10n'], $l10n);
        }

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

        return $this;
    }
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;
	}
896228
public static function collectionStatic(array $options = []) : \Object\Collection {
		$options['model'] = get_called_class();
		return \Object\Collection::collectionToModel($options);
	}
749334
public function setOptions($options)
	{
		$options = is_array($options) ? $options : array($options);

		foreach ($options as $option)
		{
			$this->addOption($option);
		}

		return $this;
	}
301549
private function resolveOptions(array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configure($resolver);

        return $resolver->resolve($options);
    }