Set the user's preferences.

@param  string|array  $value

@return void
17935
public function setPreferencesAttribute($preferences)
    {
        if (is_array($preferences)) {
            $preferences = json_encode($preferences);
        }

        $this->attributes['preferences'] = $preferences;
    }
213469
public function offsetSet($offset, $value)
    {
        if (isset($this->config[$offset])) {
            $this->config[$offset] = $value;
        }
    }
105454
public function set_value($value) {

        if ($this->running_javascript()) {
            // Check on radio button.
            $this->field->click();

            // Trigger the onchange event as triggered when 'selecting' the radio.
            if (!empty($value) && !$this->field->isSelected()) {
                $this->trigger_on_change();
            }
        } else {
            // Goutte does not accept a check nor a click in an input[type=radio].
            $this->field->setValue($this->field->getAttribute('value'));
        }
    }
605593
public function set($value) {
        $finalgrade = false;
        $trimmed = trim($value);
        if (empty($trimmed)) {
            $feedback = null;
        } else {
            $feedback = $value;
        }

        $this->grade->grade_item->update_final_grade(
            $this->grade->userid, $finalgrade, 'singleview',
            $feedback, FORMAT_MOODLE
        );
    }
1073
public function set($name, $value = null)
    {
        if (is_array($name)) {
            $this->parameters = array_replace($this->parameters, $name);
        } else {
            $this->parameters[trim(strtolower($name))] = is_string($value) ? trim($value) : $value;
        }
    }
417004
public function setValue($value)
    {
        if (is_array($value) && isset($value[0]) && $value[0] instanceof DateTimeInterface) {
            $this->setDateTimes($value);
        } elseif ($value instanceof DateTimeInterface) {
            $this->setDateTimes([$value]);
        } else {
            parent::setValue($value);
        }
    }
560188
public function set($name, $value)
	{
		if ( $value === null ) {
			unset($this->settings[$name]);
		}
		else {
			$this->settings[$name] = $value;
		}

		$this->store();
	}
486873
public function setValue($value)
    {
        if (is_scalar($value) or is_null($value)) {
            return;
        }
        foreach ($value as $name => $val) {
            if ($field = $this[$name]) {
                $field->getElement()->setValue($val);
            }
        }
    }
601745
public function setValue($value)
	{
		if ( $value == $this->getValue() ) {
			return;
		}

		$this->_values['value'] = (string) $value;

		$this->setModified();
	}
1046313
public function setValue($value)
    {
        // special case for boolean values
        if (is_bool($value)) {
            if ($value) {
                $this->_value = "true";
            } else {
                $this->_value = "false";
            }
        } else {
            $this->_value = (string) $value;
        }
    }
706900
public function set($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $configKey => $configValue) {
                $this->setSingleItem($configKey, $configValue);
            }
        } else {
            $this->setSingleItem($key, $value);
        }
    }
159720
function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
708718
public function setValue($value) {
		ArgUtils::valType($value, 'array');
		
		$decoratedValue = array();
		foreach ($value as $key => $fieldValue) {
			$decoratedValue[$key] = array(self::PROPERTY_NAME => $fieldValue);
		}
		$this->decorated->setValue($decoratedValue);
	}
892539
public function setFlags( $value )
	{
		if ( $value == $this->getFlags() ) { return; }

		$this->_checkFlags($value);
		$this->_values['flags'] = (int) $value;
		$this->setModified();
	}
439818
public function set($name, $value)
    {
        if (null !== $this->parser) {
            list($name, $value) = call_user_func($this->parser, $name, $value);
        }

        $this->options[$name] = $value;
    }
454623
public function SetPreference($Name, $Value = '', $SaveToDatabase = TRUE) {
      if (!is_array($Name))
         $Name = array($Name => $Value);

      foreach($Name as $Key => $Val) {
         $this->_Preferences[$Key] = $Val;
      }

      if ($SaveToDatabase && $this->UserID > 0) {
         $UserModel = Gdn::UserModel();
         $UserModel->SavePreference($this->UserID, $Name);
      }
   }
491670
public function setValue($value)
    {
        if (is_string($value) && strlen($value) > 100) {
            $value = substr($value, 0, 96).'...'; 
        }
        $this->value = $value;
    }