/*
Performs a selective update of fields present.
@param settings[StringArray] exclude array of field names that are always ignored when updating this
160781
function(model, id, settings, obj, options, cb) {
      var fieldName, i, len, ref;
      if (settings == null) {
        settings = {};
      }
      if (obj == null) {
        obj = {};
      }
      if (options == null) {
        options = {};
      }
      if (cb == null) {
        cb = function() {};
      }
      Hoek.assert(model, i18n.assertModuleRequired);
      Hoek.assert(id, i18n.assertIdRequired);
      ref = settings.exclude || [];
      for (i = 0, len = ref.length; i < len; i++) {
        fieldName = ref[i];
        delete obj[fieldName];
      }
      if (_.isFunction(options)) {
        cb = options;
        options = {};
      }
      return model.findByIdAndUpdate({
        _id: asObjectId(id)
      }, {
        $set: obj
      }, {
        "new": true
      }, cb);
    }
941418
def set_hidden_field(field_locator, options = {})
      field = locate_field(field_locator, HiddenField)
      field.set(options[:to])
    end
352810
protected function addModelSettings(array &$settings)
    {
        $empty = $this->util->getTranslated()->getEmptyDropdownArray();

        $settings['elementClass'] = 'Select';
        $settings['multiOptions'] = $empty + $this->util->getDbLookup()->getUserConsents();
    }
50118
@Override
    public void setSetting(String setting) throws CDKException {
        if (settings.contains(setting)) {
            this.setting = setting;
        } else {
            throw new CDKException("Setting " + setting + " is not allowed.");
        }
    }
450967
def _update(self, **kwargs):
        
        for key, value in _iteritems(kwargs):
            if key == 'settings':
                if isinstance(value, dict):
                    if self.settings is None:
                        self.settings = Settings(**value)
                    else:
                        self.settings._update(**value)
                else:
                    self.settings = copy.deepcopy(value)
            else:
                setattr(self, key, value)
1230645
public function updateSettings()
    {
        foreach ($this->settings as $key => &$value)
        {
            if (!is_null(arg($key)))
            {
                $value = arg($key);
            }
        }
        $this->onSettingsUpdate();
        $this->saveSettings();
    }
691136
public void updateSettings(FrameSettings settings) {
        if (settings.getHeaderTableSize() != -1) {
            headerTableSize = settings.getHeaderTableSize();
        }
        if (settings.getEnablePush() != -1) {
            enablePush = settings.getEnablePush();
        }
        if (settings.getMaxConcurrentStreams() != -1) {
            maxConcurrentStreams = settings.getMaxConcurrentStreams();
        }
        if (settings.getInitialWindowSize() != -1) {
            initialWindowSize = settings.getInitialWindowSize();
        }
        if (settings.getMaxFrameSize() != -1) {
            maxFrameSize = settings.getMaxFrameSize();
        }
        if (settings.getMaxHeaderListSize() != -1) {
            this.maxHeaderListSize = settings.getMaxHeaderListSize();
        }
    }
307926
public function update_settings() {
		if ( isset( $_POST['option_page'] ) &&
			'github_updater' === $_POST['option_page']
		) {
			$options = $this->filter_options();
			update_site_option( 'github_updater', $this->sanitize( $options ) );
		}

		/**
		 * Save $options in add-on classes.
		 *
		 * @since 8.0.0
		 */
		do_action( 'github_updater_update_settings', $_POST );

		$this->redirect_on_save();
	}
728419
public void setSettings(Settings settings) throws IOException {
    synchronized (writer) {
      synchronized (this) {
        if (shutdown) {
          throw new ConnectionShutdownException();
        }
        okHttpSettings.merge(settings);
      }
      writer.settings(settings);
    }
  }
728321
public App addAllSettings(Map<String, Object> settings) {
		// add the new settings one at a time so the add setting listeners are invoked
		if (settings != null && !settings.isEmpty()) {
			for (Map.Entry<String, Object> iter : settings.entrySet()) {
				addSetting(iter.getKey(), iter.getValue());
			}
		}
		return this;
	}
466519
public void setCustomFields(Map<String, String> fields) {
        clearCustomFields();
        for (String key : fields.keySet()) {
            CustomField f = new CustomField();
            f.setName(key);
            f.setValue(fields.get(key));
            customFields.add(f);
        }
    }
203733
protected function addModelSettings(array &$settings)
    {
        $empty = [];
        $multi = explode(parent::FIELD_SEP, $this->_fieldDefinition['gtf_field_values']);
        if (empty($this->_fieldDefinition['gtf_field_values']) || empty($multi)) {
            $multi = $this->util->getTranslated()->getYesNo();
        }

        if ($this->_fieldDefinition['gtf_required'] !== 1) {
            $empty = $this->util->getTranslated()->getEmptyDropdownArray();
        }

        $settings['elementClass'] = 'Radio';
        $settings['separator'] = ' ';
        $settings['multiOptions'] = $empty + array_combine($this->keyValues, array_slice($multi, 0, 2));
        if ($this->_fieldDefinition['gtf_field_default'] !== null) {
            $settings['default'] = (int)$this->_fieldDefinition['gtf_field_default'];
        }
    }
136528
protected function addModelSettings(array &$settings)
    {
        $concatter = new \MUtil_Model_Type_ConcatenatedRow(parent::FIELD_SEP, ' ', false);
        $multi     = explode(parent::FIELD_SEP, $this->_fieldDefinition['gtf_field_values']);
        $settings  = $concatter->getSettings() + $settings;

        $settings['elementClass'] = 'MultiCheckbox';
        $settings['multiOptions'] = array_combine($multi, $multi);
    }
1046306
protected function updateSettings(array $settings)
    {
        $this->controlAccess('module_edit');

        $this->module->setSettings('export', $settings);
        $this->redirect('', $this->text('Settings have been updated'), 'success');
    }
1012598
def update(self, settings):
        """"""
        self.settings.cache_clear()
        self._settings = settings
        log.info("Updated settings to %s", self._settings)
        self._update_disabled_plugins()
963194
void setFields(Field[] fields) {
    this.fields = fields;
    this.resultSetColumnNameIndexMap = null;
    this.cachedMaxResultRowSize = null;
    this.needUpdateFieldFormats = fields != null;
    this.hasBinaryFields = false; // just in case
  }
997525
private function applyFilters(array $settings): void
    {
        $data = $this->getSource();
        $data = array_filter(
            $data,
            function ($row) use ($settings) {
                foreach ($settings as $column => $filters) {
                    foreach ($filters as $filter => $value) {
                        // switch statement for filter
                        switch ($filter) {
                            case Grid\Grid::FILTER_EQ:
                                if ($row[$column] != $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_NE:
                                if ($row[$column] == $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GT:
                                if ($row[$column] <= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GE:
                                if ($row[$column] < $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LT:
                                if ($row[$column] >= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LE:
                                if ($row[$column] > $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LIKE:
                                if (!preg_match('/' . $value . '/', $row[$column])) {
                                    return false;
                                }
                                break;
                        }
                    }
                }
                return true;
            }
        );
        $this->setSource($data);
    }