public function setOptions($options)
    {
        if (!is_array($options) && !$options instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Parameter provided to %s must be an array or Traversable',
                __METHOD__
            ));
        }

        foreach ($options as $key => $value) {
            $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
            if (method_exists($this, $setter)) {
                $this->{$setter}($value);
            } else {
                $this->setOption($key, $value);
            }
        }
        return $this;
    }
public function setOptions($options)
    {
        if (!is_array($options) && !$options instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Parameter provided to %s must be an array or Traversable',
                __METHOD__
            ));
        }

        foreach ($options as $key => $value) {
            $setter = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
            if (method_exists($this, $setter)) {
                $this->{$setter}($value);
            } else {
                $this->setOption($key, $value);
            }
        }
        return $this;
    }
public function setOptions ( $ options ) { if ( ! is_array ( $ options ) && ! $ options instanceof Traversable ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Parameter provided to %s must be an array or Traversable' , __METHOD__ ) ) ; } foreach ( $ options as $ key => $ value ) { $ setter = 'set' . str_replace ( ' ' , '' , ucwords ( str_replace ( '_' , ' ' , $ key ) ) ) ; if ( method_exists ( $ this , $ setter ) ) { $ this -> { $ setter } ( $ value ) ; } else { $ this -> setOption ( $ key , $ value ) ; } } return $ this ; }
Set many options at once

If a setter method exists for the key, that method will be called;
otherwise, a standard option will be set with the value provided via
{@link setOption()}.

@param  array|Traversable $options
@return StandardConfig
@throws Exception\InvalidArgumentException
Set many options at once