setContent

var user = kuzzle.security.fetchUser('myuser');
var userContent = {
  profileIds: ['profileId']
};

user = user.setContent(userContent);
JSONObject newContent = new JSONObject()
  .put("profileIds", new JSONArray()
    .put("profileId")
  );

user.setContent(newContent);
<?php

use Kuzzle\Security\User;

// ...

$userContent = [
  'profileIds' => ['profileId']
];

/*
 * @var $user User
 */
$user->setContent($userContent);

Replaces the content of User


setContent(data)

ArgumentsTypeDescription
dataJSON ObjectUser content

Return value

Returns the User object.