Add (or replace) an color picker option.

@param  string $key The setting to add/replace.
@param  mixed  $val The setting's value to apply.
@throws InvalidArgumentException If the identifier is not a string.
@return ColorpickerInput Chainable
974392
public function addPickerOption($key, $val)
    {
        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'Setting key must be a string.'
            );
        }

        // Make sure default options are loaded.
        if ($this->pickerOptions === null) {
            $this->pickerOptions();
        }

        $this->pickerOptions[$key] = $val;

        return $this;
    }
437169
public function set($key, $val)
    {
        $this->_data = Hash::merge([$key => $val], $this->_data);
        return $this;
    }
1331406
protected function setMissingProperty($key, $val)
    {
        if (is_numeric($key)) {
            $key = $val;
            $val = true;
        }

        if ($val === true) {
            $this->addClass($key);

            return;
        } elseif ($val === false) {
            $this->removeClass($key);

            return;
        }

        throw new Exception([
            'Unable to set property for the object',
            'object'   => $this,
            'property' => $key,
            'value'    => $val,
        ]);
    }
929398
function offsetset($key,$val) {
		return Base::instance()->visible($this,$key)?
			($this->$key=$val):$this->set($key,$val);
	}
124108
protected function Add( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value + $val->_value );
	}
4194
public function append($key, $val, $ttl=null)
	{
	    $old = $this->get($key);
	    $val = $this->formatter->append($old, $val);
	    return $this->set($key, $val, $ttl);
	}
67584
public function add($key, $value) {
        if (isset($this->data[$key])) {
            throw new \InvalidArgumentException("Key $key is already set");
        }
        $this->data[$key] = $value;
    }
403829
public function set($key, $value)
	{
		if ( !($value instanceof Option) &&
			!($value instanceof Optgroup) )
		{
			throw new \InvalidArgumentException('Only Options or Optgroups can be added to a Select.');
		}

		parent::set($key, $value);
		return $this;
	}
962892
public function setAttribute($key, $val)
    {
        try {
            return $this->_stmt->setAttribute($key, $val);
        } catch (PDOException $e) {
            // require_once 'Zend/Db/Statement/Exception.php';
            throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
        }
    }
488761
public function addData($key, $value)
    {
        if (!is_string($key) && !is_int($key)) {
            throw new \InvalidArgumentException('Data keys must be of type "string" or "integer".');
        }

        $data = $this->getData();

        $data[$key] = $value;

        return $this->setData($data);
    }
680430
protected function custom($key, $val)
    {
        $extra = [
            'value' => (isset($val['name'])) ? $val['name'] : $key,
        ];

        return $this->composeElement($key, $val, $extra);
    }
1351531
public function setCurlOpt($opt, $val)
    {
        if (!is_int($opt))
        {
            throw new \InvalidArgumentException(sprintf(
                '%s::setCurlOpt - Argument 1 expected to be integer, %s seen.',
                get_class($this),
                gettype($opt)
            ));
        }

        $this->curlOpts[$opt] = $val;
        return $this;
    }
799833
public static function setContextDataByKey(string $key, $val)
    {
        $coroutineId = self::getCoroutineId();
        self::$context[$coroutineId][self::DATA_KEY][$key] = $val;
    }
1040449
public function set($key, $val)
    {
        if (!$this->locked) {
            $this->options[$key] = $val;
        }

        return $this;
    }
268968
public function set($key,$val)
    {
        if (array_key_exists($key, $this->extras)) {
            $this->extras[$key] = $val;

            return $val;
        }

        return parent::set($key, $val);
    }
1334654
protected function setValidationError($key, $val)
    {
        if (!in_array('submit', $val)) {
            // Is $validator is instance of ValidatorInterface and given key has error associated
            // then add a span tag below the input element and display error.
            if ($this->validator instanceof ValidatorInterface && $this->validator->hasError($key)) {
                $this->elements[self::$formHolder[self::$formName]][$key.'.error'] =
                    '<span class="'.$this->errorClass.'">'.$this->validator->getErrors($key).'</span>'.PHP_EOL;
            }
        }
    }
336787
public function setOption($key, $value)
    {
        if (!in_array($key, $this->availableOptions)) {
            throw new Exception\InvalidArgumentException('Invalid option for Tooltip');
        }

        if (is_bool($value)) {
            $value = $value ? 'true' : 'false';
        }

        if (!is_string($value)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid value for Tooltip, expected boolean or string, got "%s"',
                gettype($value)
            ));
        }

        $this->getElement()->addAttribute("data-$key", $value);

        return $this;
    }