Accepts an array of options enabling the declaration and instantiation of the broker object.

@param array $options

@return Rhubarb
@throws Exception
963413
public function setBroker(array $options)
    {
        $namespace = self::RHUBARB_BROKER_NAMESPACE;
        if (isset($options['class_namespace']) && $options['class_namespace']) {
            $namespace = $options['class_namespace'];
        }
        $namespace = rtrim($namespace, self::NS_SEPERATOR);
        $brokerClass = $namespace . self::NS_SEPERATOR . $options['type'];
        if (!class_exists($brokerClass)) {
            throw new Exception(
                sprintf('Broker class [%s] unknown', $brokerClass)
            );
        }
        $reflect = new \ReflectionClass($brokerClass);
        $this->broker = $reflect->newInstanceArgs(array((array)@$options['options']));

        return $this;
    }
1258219
public function addOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->setOption($name, $value);
        }

        return $this;
    }
209678
protected function init($options)
    {
        foreach ($options as $parameterName => $parameterValue) {
            if ( ! isset ($this->{$parameterName})) {
                throw new \Exception ("The parameter $parameterName is not a valid parameter name");
            }

            if (gettype($this->{$parameterName}) != gettype($parameterValue)) {
                throw new \Exception ("The parameter value type passed for $parameterName is not an accepted type, only " . gettype($this->{$parameterName}));
            }

            $this->{'set' . ucfirst($parameterName)}($parameterValue);
        }
    }
1262667
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['Name'], 'options[Name]');
        Validate::notNull($options['ParentAssetId'], 'options[ParentAssetId]');

        $assetFile = new self($options['Name'], $options['ParentAssetId']);
        $assetFile->fromArray($options);

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

        return $this;
    }
363374
protected function createNavbarContainerClass(array $options)
    {
        // Create navbar container class
        $containerClass = 'navbar';
        if ($options['inverse']) {
            $containerClass .= ' navbar-inverse';
        }
        if ($options['fixed']) {
            $containerClass .= ' navbar-fixed-';
            switch ($options['fixed']) {
                case 'top':
                case 'bottom':
                    $containerClass .= $options['fixed'];
                    break;
                default:
                    throw new Exception\InvalidArgumentException(
                        'Only top and bottom are acceptable navbarFixed options'
                    );
            }
        }
        return $containerClass;
    }
1336508
public function setOptions($options = array())
    {
        if ($options instanceof Traversable) {
            $options = ArrayUtils::iteratorToArray($options);
        }

        if (!is_array($options)) {
            throw new \Exception('Config parameter is not a valid');
        }

        foreach ($options as $key => $value) {
            $this->options[$key] = $value;
        }

        return $this;
    }
708203
public function getEncoderService(array $options = [])
	{
		$options = $options ?: $this->getOptions();
		
		if (isset($options[static::OPTION_USE_QUEUE]) && $options[static::OPTION_USE_QUEUE])
		{
			/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
			return new EncoderQueue($this->options[static::OPTION_USE_QUEUE], $options);
		}
		
		/** @noinspection ExceptionsAnnotatingAndHandlingInspection */
		return new Encoder($options);
	}
983281
protected function setOptions($options)
    {
        if (is_null($this->options)) {
            $this->preloadDefaults(true);
        }
        
        foreach ($options as $k => $v) {
            if (!isset($this->options[$k])) {
                throw new \Exception("Option $k not allowed.");
            }
            $this->options[$k] = $v;
        }
    }
214881
public function set_options(array $options)
	{
		foreach ($options as $key => $val)
		{
			$this->options[$key] = $val;
		}

		return $this;
	}
1339562
public function insert(array $options=array()) {
		$options += self::$insertDefaults;
		if( empty($options['table']) ) {
			throw new Exception('Empty table option');
		}
		if( empty($options['what']) ) {
			throw new Exception('No field');
		}
		$OPTIONS = '';
		$OPTIONS .= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : (!empty($options['delayed'])) ? ' DELAYED' : '';
		$OPTIONS .= (!empty($options['ignore'])) ? ' IGNORE' : '';
		$OPTIONS .= (!empty($options['into'])) ? ' INTO' : '';
		
		$COLS = $WHAT = '';
		//Is an array
		if( is_array($options['what']) ) {
			//Is an indexed array of fields Arrays
			if( !empty($options['what'][0]) ) {
				// Quoted as escapeIdentifier()
				$COLS = '(`'.implode('`, `', array_keys($options['what'][0])).'`)';
				foreach($options['what'] as $row) {
					$WHAT .= (!empty($WHAT) ? ', ' : '').'('.implode(', ', $row).')';
				}
				$WHAT	= 'VALUES '.$WHAT;
			//Is associative fields Arrays
			} else {
// 				$WHAT	= 'SET '.parseFields($options['what'], '`');
				$WHAT	= 'SET '.$this->formatFieldList($options['what']);
			}
			
		//Is a string
		} else {
			$WHAT	= $options['what'];
		}
		$TABLE		= static::escapeIdentifier($options['table']);
		
		$QUERY = "INSERT {$OPTIONS} {$TABLE} {$COLS} {$WHAT}";
		if( $options['output'] == static::SQLQUERY ) {
			return $QUERY;
		}
		return $this->query($QUERY, PDOEXEC);
	}
695766
public function delete(array $options=array()) {
		$options += self::$deleteDefaults;
		if( empty($options['table']) ) {
			throw new Exception('Empty table option');
		}
		$OPTIONS	= '';
		$OPTIONS	.= (!empty($options['lowpriority'])) ? ' LOW_PRIORITY' : '';
		$OPTIONS	.= (!empty($options['quick'])) ? ' QUICK' : '';
		$OPTIONS	.= (!empty($options['ignore'])) ? ' IGNORE' : '';
		$WC			= ( !empty($options['where']) ) ? 'WHERE '.$options['where'] : '';
		$ORDERBY	= ( !empty($options['orderby']) ) ? 'ORDER BY '.$options['orderby'] : '';
		$LIMIT		= ( $options['number'] > 0 ) ? 'LIMIT '.
			( ($options['offset'] > 0) ? $options['offset'].', ' : '' ).$options['number'] : '';
		$TABLE		= static::escapeIdentifier($options['table']);
		
		$QUERY		= "DELETE {$OPTIONS} FROM {$TABLE} {$WC} {$ORDERBY} {$LIMIT}";
		if( $options['output'] == static::SQLQUERY ) {
			return $QUERY;
		}
		return $this->query($QUERY, PDOEXEC);
	}
117494
public function setCommandOptions(array $options)
    {
        foreach ($options as $name => $option) {
            if ((!$option instanceof Parameter\Option)) {
                throw new \Parable\Console\Exception(
                    "Options must be instances of Parameter\\Option. {$name} is not."
                );
            }
            $this->commandOptions[$option->getName()] = $option;
        }
        return $this;
    }
1175803
public function withOptions(int ...$options): OptionsInterface
    {
        foreach ($options as $option) {
            $this->options |= $option;
        }

        return $this;
    }
1039640
public function exception(\Exception $e, array $options = [])
    {
        $message = $this->createExceptionMessages($e);
        return $this->message($message);
    }
446404
public function withOptions($options)
    {
        if (is_array($options)) {
            $options = new RequestOptions($options);
        }

        $this->options = $options;

        return $this;
    }
805161
public function setOptions(iterable $options)
    {
        if (!is_iterable($options)) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    '"%s" expects an array or Traversable; received "%s"',
                    __METHOD__,
                    gettype($options)
            )
            );
        }

        foreach ($options as $key => $value) {
            $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
            if (method_exists($this, $setter)) {
                $this->{$setter}($value);
            } elseif (array_key_exists($key, $this->options)) {
                $this->options[$key] = $value;
            } else {
                throw new Exception\InvalidArgumentException(sprintf(
                    'The option "%s" does not have a matching %s setter method or options[%s] array key',
                    $key,
                    $setter,
                    $key
                ));
            }
        }

        return $this;
    }