save fields value
518496
def save_cfror_fields(fields)
      fields.each do |field, value|
        field = Cfror::Field.find(field)
        field.save_value!(self, value)
      end
    end
1059505
public function save() {
        $configdata = $this->get('configdata');
        if (!array_key_exists('defaultvalue_editor', $configdata)) {
            $this->field->save();
            return;
        }

        if (!$this->get('id')) {
            $this->field->save();
        }

        // Store files.
        $textoptions = $this->value_editor_options();
        $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];
        $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],
            'customfield_textarea', 'defaultvalue', $this->get('id'));

        $configdata['defaultvalue'] = $tempvalue->defaultvalue;
        $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;
        unset($configdata['defaultvalue_editor']);
        $this->field->set('configdata', json_encode($configdata));
        $this->field->save();
    }
726416
protected function submitAddFieldValue()
    {
        $this->setSubmitted(null, $this->getParam());
        $this->validateComponent('field_value');
        $this->addFieldValue();
    }
518063
def save_value(self, name, value):
        """"""
        session_name = 'list_{}_{}_{}'.format(self.kwargs.get('app'), self.kwargs.get('model'), name)
        self.request.session[session_name] = value
        setattr(self, name, value)
        return value
1055691
function( field, prefix ) {
					var self = this;
					if ( 'onpropertychange' in field ) {
						field.get(0).onpropertychange = function() {
							self.saveToBrowserStorage( prefix, field.val() );
						};
					} else {
						field.get(0).oninput = function() {
							self.saveToBrowserStorage( prefix, field.val() );
						};
					}
					if ( this.isCKEditorExists() ) {
						var editor = CKEDITOR.instances[ field.attr("name") ] || CKEDITOR.instances[ field.attr("id") ];
						if ( editor ) {
							editor.document.on( 'keyup', function() {
								editor.updateElement();
								self.saveToBrowserStorage( prefix, field.val() );
							} );
						}
					}
				}
569441
public void saveValue()
    {
        BaseField field = this.getOwner();
        RecordOwner recordOwner = field.getRecord().getRecordOwner();
        if (recordOwner instanceof ComponentParent)
            this.saveValue((ComponentParent)recordOwner);
    }
638743
function setNestedValue(data, field, value) {
        var fieldParts = _.isArray(field) ? field : field.split('.');

        // if no nesting, just set the value
        if (fieldParts.length === 1) {
            data[field] = _.isString(value) ? value.trim() : value;
            return;
        }

        // make sure the parent value exists
        data[fieldParts[0]] = data[fieldParts[0]] || {};

        // recursively call to go down a level
        setNestedValue(data[fieldParts[0]], fieldParts.slice(1, fieldParts.length), value);
    }
177022
public function save() {

		if(null === $this -> getAdapter()) {
			return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
		}

		//Execute user defined before save function
		$this -> beforeSave();

		$class   = new \ReflectionClass(get_class($this));
		$values  = $this -> toArray();
		$columns = [];

		array_walk($values, function($a, $b) use (&$columns, &$values) { 

			if(true === in_array($b, $this -> exclude)) {
				
				unset($values[$b]);
				return;
			}

			if($a instanceof DateTime) {
				$values[$b] = $a -> loadFormat();
			}

			if(true === is_array($a)) {
				$values[$b] = json_encode($a);
			}

			$columns[] = sprintf('`%s` = VALUES(`%s`)', $this -> getAdapter() -> escape($b), $this -> getAdapter() -> escape($b));
		});

		//Convert column names to column names with backtics
		foreach($values as $column => $value) {
			
			$values['`' . $column . '`'] = $value;
			unset($values[$column]);
		}

		$query = sprintf('INSERT INTO %s (%s) VALUES(%s) ON DUPLICATE KEY UPDATE %s', $this -> getAdapter() -> escape($this -> getTable()), implode(array_keys($values), ', '), implode(array_fill(0, count($values), '?'), ','), implode($columns, ', '));

		$this -> getAdapter() -> query($query, array_values($values));

		$success = $this -> getAdapter() -> execute();
		
		//Set new id if last id is not null
		$id  		= $this -> getAdapter() -> getLastId();
		$ids 		= $this -> getIdentifier();
		$affected 	= $this -> getAdapter() -> getAffected();

		if(count($ids) > 0 && $affected > 0) {

			$method = sprintf('set%s', NameConvert :: toCamelcase($ids[0], true));

			if(true === method_exists($this, $method)) {
				call_user_func_array([$this, $method], [$id]);
			}
		}

		//Execute user defined after save function
		$this -> afterSave();

		return $success;
	}
332718
protected function deleteFieldValue()
    {
        $this->controlAccess('field_value_delete');

        if ($this->field_value->delete($this->data_field_value['field_value_id'])) {
            $url = "admin/content/field/value/{$this->data_field['field_id']}";
            $this->redirect($url, $this->text('Field value has been deleted'), 'success');
        }

        $this->redirect('', $this->text('Field value has not been deleted'), 'warning');
    }
13243
def fill_fields(self, **kwargs):
        """"""
        for name, value in kwargs.items():
            field = getattr(self, name)
            field.send_keys(value)
1170104
def set_field(self, name, value):
        """"""
        f = getattr(self, name, None)
        if isinstance(f, DataField):
            f.set(self, value)
        else:
            raise FieldError("No field named '%s'" % name)
1340438
public function saveFields()
    {
        if (empty($this->fields)) {
            return;
        }

        $ids = [];

        // Retrieve all fields ids
        foreach ($this->fields as $field) {
            if (!$field) {
                continue;
            }

            // Build contents
            $ctn = (array) $field->getModel()->getContents();
            $hasId = (boolean) $field->getModel()->getHasId();

            // Check ID
            if ($hasId && (!isset($ctn['id']) || empty($ctn['id']))) {
                continue;
            }

            $ids[] = $ctn['id'];
        }

        $this->saveRequest($ids);
        $this->saveFiles($ids);
    }
734863
public function saveSettings()
    {
        $formValues = $this->getForm()->getValues();
        $settingStorage = $this->getSettingsStorage();

        $configValue = $formValues[self::SOURCE_RADIO_NAME];
        if ($configValue === 'list') {
            $sources = trim(str_replace("\r", '', $formValues[self::SOURCE_LIST_NAME]));
            $sources = explode("\n", $sources);
            $settingStorage->set(CspHeaderSettingsInterface::CSP_HEADER_LIST, json_encode($sources));
        }

        $settingStorage->set(CspHeaderSettingsInterface::CSP_HEADER_SETTING, $configValue);
    }
505746
def set_custom_value(self, field_name, value):
        
        custom_field = self.get_custom_field(field_name)
        custom_value = CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0]
        custom_value.value = value
        custom_value.save()
222503
protected void saveFields(Collection<Field> fields, ActionBean actionBean, HttpSession session) throws IllegalAccessException {
        for (Field field : fields) {
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
            setAttribute(session, getFieldKey(field, actionBean.getClass()), field.get(actionBean), ((Session)field.getAnnotation(Session.class)).serializable(), ((Session)field.getAnnotation(Session.class)).maxTime());
        }
    }
510845
function create_field( $field )
	{
		if( 'object' == $field['save_format'] && 'null' !== $field['value'] )
			$field['value'] = array( $field['value']->class );

		// value must be array
		if( !is_array($field['value']) )
		{
			// perhaps this is a default value with new lines in it?
			if( strpos($field['value'], "\n") !== false )
			{
				// found multiple lines, explode it
				$field['value'] = explode("\n", $field['value']);
			}
			else
			{
				$field['value'] = array( $field['value'] );
			}
		}
		
		// trim value
		$field['value'] = array_map('trim', $field['value']);
		
		// html
		echo '<div class="fa-field-wrapper">';
		echo '<div class="fa-live-preview"></div>';
		echo '<select id="' . $field['id'] . '" class="' . $field['class'] . ' fa-select2-field" name="' . $field['name'] . '" >';	
		
		// null
		if( $field['allow_null'] )
		{
			echo '<option value="null">- ' . __("Select",'acf') . ' -</option>';
		}
		
		// loop through values and add them as options
		if( is_array($field['choices']) )
		{
			unset( $field['choices']['null'] );

			foreach( $field['choices'] as $key => $value )
			{
				$selected = $this->find_selected( $key, $field['value'], $field['save_format'], $field['choices'] );
				echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
			}
		}

		echo '</select>';
		echo '</div>';
	}
843432
protected function setTitleEditFieldValue()
    {
        if (isset($this->data_field_value['field_value_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_field_value['title']));
        } else {
            $title = $this->text('Add value for field %name', array('%name' => $this->data_field['title']));
        }

        $this->setTitle($title);
    }