/*
returns the data without any of the extra fields
that may have been added when edit() was called
332687
public function getData($flag = FormInterface::VALUES_NORMALIZED)
    {
        $data = parent::getData($flag);
        if (false === $this->isNew()) {
            foreach ($this->getOriginalFields() as $field) {
                $key = 'original_' . $field;
                if (array_key_exists($key, $data)) {
                    unset($data[$key]);
                }
            }
        }
        return parent::getData($flag);
    }
892232
public function definition_after_data() {
        global $CFG, $DB, $OUTPUT;

        $mform = $this->_form;
        $userid = $mform->getElementValue('id');

        // Trim required name fields.
        foreach (useredit_get_required_name_fields() as $field) {
            $mform->applyFilter($field, 'trim');
        }

        if ($user = $DB->get_record('user', array('id' => $userid))) {

            // Remove description.
            if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !$DB->record_exists('role_assignments', array('userid' => $userid))) {
                $mform->removeElement('description_editor');
            }

            // Print picture.
            $context = context_user::instance($user->id, MUST_EXIST);
            $fs = get_file_storage();
            $hasuploadedpicture = ($fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') || $fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg'));
            if (!empty($user->picture) && $hasuploadedpicture) {
                $imagevalue = $OUTPUT->user_picture($user, array('courseid' => SITEID, 'size' => 64));
            } else {
                $imagevalue = get_string('none');
            }
            $imageelement = $mform->getElement('currentpicture');
            $imageelement->setValue($imagevalue);

            if ($mform->elementExists('deletepicture') && !$hasuploadedpicture) {
                $mform->removeElement('deletepicture');
            }

            // Disable fields that are locked by auth plugins.
            $fields = get_user_fieldnames();
            $authplugin = get_auth_plugin($user->auth);
            $customfields = $authplugin->get_custom_user_profile_fields();
            $customfieldsdata = profile_user_record($userid, false);
            $fields = array_merge($fields, $customfields);
            foreach ($fields as $field) {
                if ($field === 'description') {
                    // Hard coded hack for description field. See MDL-37704 for details.
                    $formfield = 'description_editor';
                } else {
                    $formfield = $field;
                }
                if (!$mform->elementExists($formfield)) {
                    continue;
                }

                // Get the original value for the field.
                if (in_array($field, $customfields)) {
                    $key = str_replace('profile_field_', '', $field);
                    $value = isset($customfieldsdata->{$key}) ? $customfieldsdata->{$key} : '';
                } else {
                    $value = $user->{$field};
                }

                $configvariable = 'field_lock_' . $field;
                if (isset($authplugin->config->{$configvariable})) {
                    if ($authplugin->config->{$configvariable} === 'locked') {
                        $mform->hardFreeze($formfield);
                        $mform->setConstant($formfield, $value);
                    } else if ($authplugin->config->{$configvariable} === 'unlockedifempty' and $value != '') {
                        $mform->hardFreeze($formfield);
                        $mform->setConstant($formfield, $value);
                    }
                }
            }

            // Next the customisable profile fields.
            profile_definition_after_data($mform, $user->id);

        } else {
            profile_definition_after_data($mform, 0);
        }
    }
957483
protected Map<String, Object> getSignableData()
    {
    	final Map<String, Object> doc = getSendableData();

    	// remove node-specific data
    	for (int i = 0; i < excludedFields.length; i++) {
    		doc.remove(excludedFields[i]);
    	}
        return doc;
    }
717114
def clear_modified_data(self):
        
        self.__modified_data__ = {}
        self.__deleted_fields__ = []

        for value in self.__original_data__.values():
            try:
                value.clear_modified_data()
            except AttributeError:
                pass
566088
function getExpandoData(ownerDocument) {
    var data = expandoData[ownerDocument[expando]];
    if (!data) {
        data = {};
        expanID++;
        ownerDocument[expando] = expanID;
        expandoData[expanID] = data;
    }
    return data;
  }
867019
public static function getExtraFields(){
        return array_map(function($field){
            $extra = [
                'id' => $field['id'],
                'label' => $field['label'],
                'filterable' => array_key_exists('filterable', $field) ? $field['filterable'] : false,
            ];
            if (array_key_exists('columnPosition', $field)) {
                $extra['columnPosition'] = $field['columnPosition'];
            }
            return $extra;
        }, self::_getUserExtraFields());
    }
209887
public String getExtraDataExpression() {
    String result = null;
    if (hasExpressionAsExtraData()) {
      result = this.extraData.substring(1, this.extraData.length() - 1);
    }
    return result;
  }
1258201
public Object getFieldData(String strFieldName)
    {
        FieldInfo fieldInfo = m_table.getRecord().getField(strFieldName);
        if (fieldInfo != null)
            return fieldInfo.getData();
        return null;
    }
353528
def get_fields(self):
        
        result = [key for key in self.__original_data__.keys()
                  if key not in self.__deleted_fields__]
        result.extend([key for key in self.__modified_data__.keys()
                       if key not in result and key not in self.__deleted_fields__])

        return result
191507
function edit($ID, $NewTitle = null, $NewDescription = null)
	{
		$Data = array ();

		if ($NewTitle !== null)
			$Data ['Title'] = $NewTitle;

		if ($NewDescription !== null)
			$Data ['Description'] = $NewDescription;

        return $this->{$this->type ()}->editData ( $Data, "ID=?", $ID ) == 1;
	}
693242
public function forTemplate()
    {
        $isEditable = FrontendEditing::editingEnabled() && FrontendEditing::isEditable($this);
        $value      = parent::forTemplate();
        if ($isEditable) {
            $field = $this->formField(null, null, false, $value)->
                setAttribute('data-feclass', FrontendEditing::getClassName($this))->
                setAttribute('data-feid', FrontendEditing::getID($this))->
                setAttribute('data-fefield', $this->name)->
                addExtraClass("frontend-editable frontend-editable-enum");
            $value = $field->forTemplate();
        }
        return $value;
    }
248138
public function get_submitted_data() {
        $data = parent::get_submitted_data();
        if (is_object($data)) {
            foreach (static::$fieldstoremove as $field) {
                unset($data->{$field});
            }
            $data = static::convert_fields($data);
        }
        return $data;
    }
529103
public String edit() {
    Entity<?> entity = getEntity();
    put(getShortName(), entity);
    editSetting(entity);
    return forward();
  }
839509
function cleanUpData(data) {
  if (!(data instanceof Tag$1) && !(data && isFunction(data.trigger)))
    { return data }

  var o = {};
  for (var key in data) {
    if (!RE_RESERVED_NAMES.test(key)) { o[key] = data[key]; }
  }
  return o
}
453301
function cleanUpData(){
      var v = $contentDomNode.html().replace(/<br\s*\/?>/mg,"\n");
      v = v.replace(/<div>/gi,"\n").replace(/<\/div>/gi,'');
      v = v.replace(/(<([^>]+)>)/ig,'');
      return $.trim(v.replace(/&nbsp;/ig,''));
    }
1264033
public static function emptyDatasource() {
        static $dsp = false;
        if ($dsp === false) {
            $dsp = new FieldDataProvidor(null, null, null);
        }

        return $dsp;
    }
835812
public function get_update_data_params(
		/** @noinspection PhpUnusedParameterInspection */
		$post, $update
	) {
		$params = [];
		foreach ( $this->get_data_field_settings() as $k => $v ) {
			$params[ $k ] = $this->get_post_field( $k, $update || ! $v['required'] ? null : $v['default'], null, $v );
			$params[ $k ] = $this->sanitize_input( $params[ $k ], $v['type'] );
			if ( ! isset( $params[ $k ] ) && ! $update && $v['unset_if_null'] ) {
				unset( $params[ $k ] );
				continue;
			}
		}

		return $params;
	}