This setup is used when configuring a theme for a custom extension.
In multi tenancy though the tenant id might be use instead of the extension id.

@param $options

@return bool
978726
protected function setupOptions($options)
    {
        if(empty($options[static::EXTENSION_ID])) {
            $cls = get_class($this);
            strtok($cls, '\\');
            $options[static::EXTENSION_ID] = strtok('\\');
        }
        $options = array_merge([
            static::STYLESHEET   => Template::css('tao-3.css', 'tao'),
            static::LOGO_URL     => Template::img('tao-logo.png', 'tao'),
            static::LABEL        => $options[static::LABEL],
            static::EXTENSION_ID => $options[static::EXTENSION_ID],
            static::ID           => $options[static::EXTENSION_ID]
                                    . StringUtils::camelize(StringUtils::removeSpecChars($options[static::LABEL]), true)
        ],
            $options
        );

        if($options[static::LOGO_URL] === static::DEFAULT_PATH) {
            $options[static::LOGO_URL] = Template::img(
                $this->defaultThemePath . '/' . static::DEFAULT_LOGO_NAME,
                $options[static::EXTENSION_ID]
            );
        }

        if($options[static::STYLESHEET] === static::DEFAULT_PATH) {
            $options[static::STYLESHEET] = Template::css(
                $this->defaultThemePath . '/' . static::DEFAULT_STYLESHEET_NAME,
                $options[static::EXTENSION_ID]
            );
        }

        $this->setOptions($options);

        return true;
    }
1264288
protected function setOptions($options = [])
    {
        $myProperties = get_class_vars(__CLASS__);
        $myDefaults = $myProperties['DEFAULTS'];
        $defaults = array_replace_recursive($myDefaults, $this->DEFAULTS);

        if (empty($this->rootPath)) {
            $this->rootPath = realpath($this->getChildDir()) . '/';
        }

        $defaults['description']['jsonPath'] = realpath($this->rootPath . $this->DEFAULT_API_JSON_PATH);
        $mergedOptions = array_replace_recursive($defaults, $options);
        $parsedOptions = $this->parseOptions($mergedOptions, $mergedOptions);

        $handlers = $this->getStacks($parsedOptions);
        if (!empty($handlers)) {
            if (empty($parsedOptions['client'])) {
                $parsedOptions['client'] = [];
            }
            $parsedOptions['client']['handler'] = $handlers;
        }

        $this->options = $parsedOptions;

        return $this;
    }
106026
public function setOptions($options) 
	{
		foreach ($this->options as $key => $option) {
			if (isset($options[$key])) {
				$this->options[$key] = $options[$key];
			}
		}
	}
428171
public function optionsQueryData(& $options) {
		// column prefix
		if (empty($options['column_prefix'])) {
			$options['column_prefix'] = $this->column_prefix;
		}
		// handle pk
		if (!array_key_exists('pk', $options)) {
			$options['pk'] = $this->pk;
		}
		$pk = $options['pk'];
		// inject tenant
		if ($this->tenant && !isset($options['where'][$this->tenant_column])) {
			$options['where'][$this->tenant_column] = \Tenant::id();
		}
		// if compound key
		if (count($pk) > 1) {
			$temp = $pk;
			$last = array_pop($temp);
			foreach ($temp as $v) {
				if (empty($options['where'][$v])) {
					return [];
				}
			}
		}
		$data = $this->get($options);
		// merge acl returned from get
		if (!empty($this->acl_get_options)) {
			$options = $this->acl_get_options;
		}
		// if compound key
		if (!empty($temp)) {
			foreach ($temp as $v) {
				// if pk is array
				if (!empty($options['where'][$v]) && is_array($options['where'][$v])) {
					$result = [];
					foreach ($options['where'][$v] as $v2) {
						if (isset($data[$v2])) {
							$result = array_merge_hard($result, $data[$v2]);
						}
					}
					$data = $result;
				} else { // regular pk
					if (!isset($data[$options['where'][$v]])) {
						return [];
					}
					$data = $data[$options['where'][$v]];
				}
			}
		}
		return $data;
	}
59241
public function setOptions($options)
    {
        if (isset($this->options['modal_option'])) {
            $this->options['modal_option'] = array_merge($this->options['modal_option'], $options);
        } else {
            $this->options['modal_option'] = $options;
        }

        return $this;
    }
316326
public function config(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . $key;
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
799578
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['Name'], 'options[Name]');

        $accessPolicy = new self($options['Name']);
        $accessPolicy->fromArray($options);

        return $accessPolicy;
    }
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;
    }
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
197789
protected function register(array $options)
    {
        foreach ($options as $option => $argument) {
            if (is_bool($argument)) {
                add_theme_support($option);

                continue;
            }

            add_theme_support($option, $argument);
        }
    }
1210137
public function setOptions(OptionsInterface $options = null)
    {
        if (null !== $options && !$options instanceof Options) {
            $options = new Options($options->toArray());
        }

        $this->options = $options;
        return $this;
    }
114333
public function setUp($options = [])
    {
        parent::setUp($options);
        if (isset($options['changeid'])) {
            $this->changeid = $options['changeid'];
        }
        if (isset($options['operation'])) {
            $this->setOperation($options['operation']);
            if ($options['operation'] == 'delete') {
                $this->ignore404(true);
            }
        }
        if (isset($options['external-ids'])) {
            $this->extids = $options['external-ids'];
        }
    }
947415
protected function configureURL(array $options)
    {
        $url = $this->getEndPointUrl();
        if ($this->requiresOptions()) {
            $urlArr = explode("/",$url);
            $optional = FALSE;
            $optionNum = 0;
            $keys = array_keys($options);
            sort($keys);
            foreach($keys as $key){
                if (is_numeric($key)){
                    $optionNum = $key;
                    break;
                }
            }
            foreach($urlArr as $key => $urlPart){
                $replace = NULL;
                if (strpos($urlPart,static::$_URL_VAR_CHARACTER) !== FALSE){
                    if (strpos($urlPart,':') !== FALSE){
                        $optional = TRUE;
                        $replace = '';
                    }
                    $opt = str_replace(array(static::$_URL_VAR_CHARACTER,':'),'',$urlPart);
                    if (isset($options[$opt])){
                        $replace = $options[$opt];
                    }
                    if (isset($options[$optionNum]) && ($replace == '' || $replace == NULL)){
                        $replace = $options[$optionNum];
                        $optionNum = $optionNum+1;
                    }
                    if ($optional && $replace == ''){
                        $urlArr = array_slice($urlArr,0,$key);
                        break;
                    }
                    if ($replace !== NULL){
                        $urlArr[$key] = $replace;
                    }
                }
            }
            $url = implode("/",$urlArr);
            $url = rtrim($url,"/");
        }
        return $url;
    }
1225954
public function addOptions($options)
    {
        if (is_array($this->options)) {
            $this->options = array_merge($this->options, $options);
        } else {
            $this->options = $options;
        }

        return $this;
    }
138805
public static function setExposedOption($optionName = "") {
		
		if (!empty($optionName) && isset(self::$options[$optionName])) {
			if (!in_array($optionName,self::$options["exposedOptions"])) {
				self::$options["exposedOptions"][] = $optionName;
			}
			return true;
		}
		
		return false;
		
	}
698854
public function setOptions(array $options)
    {
        if (isset($options['indentWidth'])) {
            $this->setIndentWidth($options['indentWidth']);
        }
        if (isset($options['indent'])) {
            $this->setIndent($options['indent']);
        }
        if (isset($options['quote'])) {
            $this->setQuote($options['quote']);
        }
        if (isset($options['fgcolor'])) {
            $this->setFgColor($options['fgcolor']);
        }
        if (isset($options['bgcolor'])) {
            $this->setBgColor($options['bgcolor']);
        }
        return $this;
    }
1303107
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $method = 'set' . ucfirst($name);

            if (method_exists($this, $method)) {
                $this->$method($value);
            } else {
                $this->options[$name] = $value;
            }
        }

        return $this;
    }