Update single user meta data.

@param string $key
@param string $value

@throws UserException

@return User
772881
public function updateMetaData(string $key, string $value): User
    {
        $previous = get_user_meta($this->ID, $key, true);

        if ($previous === $value) {
            return $this;
        }

        $update = update_user_meta($this->ID, $key, $value, $previous);

        if (false === $update) {
            throw new UserException("Cannot update user meta data with a key of [$key]");
        }

        return $this;
    }
812993
protected function save(string $key, $value): void
    {
        $isNew = $this->isNewKey($key);

        list($name, $userId) = \explode('/user-', $key);

        // We should be able to ignore this if user id is empty or checksum
        // return the same value (no change occured).
        if ($this->check($key, $value) || empty($userId)) {
            return;
        }

        $this->saving($name, $userId, $value, $isNew);
    }
740681
public function setValueByKey($key, $value)
    {
        $model = Configuration::whereConfigurationKey($key)->first();

        if (null === $model) {
            return null;
        }
        $model->update(['configuration_value' => $value]);

        return $model;
    }
989400
public function set($key, $value = null)
    {
        return self::setValue($this->data, $key, $value);
    }
692131
public function setMeta($key, $value = null)
    {
        if (is_array($key) && is_null($value)) {
            $this->meta = $key;
        } else {
            array_set($this->meta, $key, $value);
        }

        return $this;
    }
426439
public function setMeta($key, $value = null)
    {
        $setMeta = 'setMeta'.ucfirst(gettype($key));

        return $this->$setMeta($key, $value);
    }
270561
public function set($key, $value)
    {
        if (method_exists($this, 'validate' . ucfirst($key))) {
            $value = call_user_func([$this, 'validate' . ucfirst($key)], $value);
        }

        $this->checkKeyExistInDefault($key);

        $this->data[$key] = $value;

        return $this;
    }
148612
protected function saveUserSingleValue($value, int $user_id)
    {
        $previous = get_user_meta($user_id, $this->getName(), true);

        if (is_null($value) || empty($value)) {
            delete_user_meta($user_id, $this->getName());
        } elseif (empty($previous)) {
            add_user_meta($user_id, $this->getName(), $value, true);
        } else {
            update_user_meta($user_id, $this->getName(), $value, $previous);
        }
    }
1372540
public function set($key, $value = null)
    {
        if (is_array($key)) {
            $this->global_data = array_merge($this->global_data, $key);
        } else {
            $this->global_data[$key] = $value;
        }

        return $this;
    }
1200298
public function setMeta(string $key, $value): ContextBuilder
    {
        $this->metas[$key] = $value;

        return $this;
    }
702439
public function setEmail(string $value) : User
    {

        if ($this->data['email'] !== $value) {
            $this->data['email'] = $value;
            $this->setModified('email');
        }

        return $this;
    }
996306
public function update( string $name, $value ) {
		if ( $this->_user->$name ) {
			return wp_update_user( [
				'ID'  => $this->ID,
				$name => $value
			] );
		} elseif ( $this->$name ) {
			return update_field( $name, $value, $this->_key );
		}
		
		return FALSE;
	}
730073
public function updateRegister($key, $value)
    {
        $this->update->updateRegister($key, new RegisterOp($value));

        return $this;
    }
466597
public function updateMeta($key, $value)
    {
        if ($meta = $this->getMeta($key)) {
            $meta->value = $value;

            return $meta->save();
        }

        return false;
    }
388446
public function setData($key, $value){

        $key = $this->normalizeKeyName($key);

        if( isset($this->_data[$key]) ){
            if( $this->_data[$key] !== $value ){
                $this->_original[$key] = $this->_data[$key];
                $this->_changes[$key] = $value;
            }
        }else{
            $this->_changes[$key] = $value;
        }

        $this->_data[$key] = $value;

        return $this;
    }
188631
public function setConfig($key,$value = ''){
		if(is_array($key)){
			$this->_config = array_merge($this->_config,$key);
		}
		else{
			$this->_config[$key] = $value;
		}
		$this->updateConfig();
		
		return $this;
	}
203915
public function setUserValue(string $value) : self
    {
        $this->user_value = $value;
        $this->is_valid = null;
        return $this;
    }