public function setOptions($options, $value = null)
    {
        // if options passed as string then second param is option value
        if (is_string($options)) {
            $options = array($options => $value);
        }

        if (!is_array($options)) {
            throw new InvalidArgumentException(
                'The $options parameter must either be an array or a string ' .
                    'containing the option name.'
            );
        }

        // new options override existing options
        $this->options = array_merge($options, $this->options);

        return $this;
    }