SDK
SDK PHP v3.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

updateSelf #


updateSelf(content, [options], [callback]) #

Performs a partial update on the current user.

ArgumentsTypeDescription
contentJSON ObjectA plain javascript object representing the user
optionsstring(Optional) Optional arguments
callbackfunction(Optional) Callback handling the response

Options #

FilterTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Return value #

Returns the Kuzzle SDK object to allow chaining.


Callback Response #

Returns the updated user object.

Usage #

<?php
use \Kuzzle\Kuzzle;
use \Kuzzle\Security\User;
$kuzzle = new Kuzzle('localhost');
$newContent = [
  'firstname' => 'My Name Is',
  'lastname' => 'Jonas'
];
try {
  $updatedUser = $kuzzle->updateSelf($newContent);
  // $updatedUser instanceof User
}
catch (ErrorException $e) {
}