public static function setConfig($id, $config, $local_config = null)
    {
        if (isset($config['parameters'])) {
            $params = $config['parameters'];
            if (!is_array($params)) {
                throw new BadRequestException('Web service parameters must be an array.');
            }
            EmailServiceParameterConfig::whereServiceId($id)->delete();
            foreach ($params as $param) {
                EmailServiceParameterConfig::setConfig($id, $param, $local_config);
            }
            unset($config['parameters']);
        }

        return parent::setConfig($id, $config, $local_config);
    }
public static function setConfig($id, $config, $local_config = null)
    {
        if (isset($config['parameters'])) {
            $params = $config['parameters'];
            if (!is_array($params)) {
                throw new BadRequestException('Web service parameters must be an array.');
            }
            EmailServiceParameterConfig::whereServiceId($id)->delete();
            foreach ($params as $param) {
                EmailServiceParameterConfig::setConfig($id, $param, $local_config);
            }
            unset($config['parameters']);
        }

        return parent::setConfig($id, $config, $local_config);
    }
{@inheritdoc}