Recombee API client

MergeUsers extends Request

Merges interactions (purchases, ratings, bookmarks, detail views ...) of two different users under a single user ID. This is especially useful for online e-commerce applications working with anonymous users identified by unique tokens such as the session ID. In such applications, it may often happen that a user owns a persistent account, yet accesses the system anonymously while, e.g., putting items into a shopping cart. At some point in time, such as when the user wishes to confirm the purchase, (s)he logs into the system using his/her username and password. The interactions made under anonymous session ID then become connected with the persistent account, and merging these two together becomes desirable.

Merging happens between two users referred to as the target and the source. After the merge, all the interactions of the source user are attributed to the target user, and the source user is deleted.

Table of Contents

$cascade_create  : bool
$ensure_https  : bool
$optional  : array<string|int, mixed>
$source_user_id  : string
$target_user_id  : string
$timeout  : int
__construct()  : mixed
Construct the request
getBodyParameters()  : array<string|int, mixed>
Get body parameters
getEnsureHttps()  : bool
Returns true if HTTPS must be chosen over HTTP for this request
getMethod()  : static
Get used HTTP method
getPath()  : string
Get URI to the endpoint
getQueryParameters()  : array<string|int, mixed>
Get query parameters
getTimeout()  : int
Get request timeout
setEnsureHttps()  : mixed
Sets if HTTPS must be chosen over HTTP for this request
setTimeout()  : mixed
Sets request timeout

Properties

$ensure_https

protected bool $ensure_https

$optional

protected array<string|int, mixed> $optional

$source_user_id

protected string $source_user_id

$target_user_id

protected string $target_user_id

Methods

__construct()

Construct the request

public __construct(string $target_user_id, string $source_user_id[, array<string|int, mixed> $optional = array() ]) : mixed
Parameters
$target_user_id : string

ID of the targer user.

$source_user_id : string

ID of the source user.

$optional : array<string|int, mixed> = array()

Optional parameters given as an array containing pairs name of the parameter => value

  • Allowed parameters:
    • cascadeCreate
      • Type: bool
      • Description: Sets whether the user targetUserId should be created if not present in the database.
Tags
throws
UnknownOptionalParameterException

UnknownOptionalParameterException if an unknown optional parameter is given in $optional

Return values
mixed

getBodyParameters()

Get body parameters

public getBodyParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

Values of body parameters (name of parameter => value of the parameter)

getEnsureHttps()

Returns true if HTTPS must be chosen over HTTP for this request

public getEnsureHttps() : bool
Return values
bool

true if HTTPS must be chosen

getMethod()

Get used HTTP method

public getMethod() : static
Return values
static

Used HTTP method

getPath()

Get URI to the endpoint

public getPath() : string
Return values
string

URI to the endpoint

getQueryParameters()

Get query parameters

public getQueryParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

Values of query parameters (name of parameter => value of the parameter)

getTimeout()

Get request timeout

public getTimeout() : int
Return values
int

Request timeout in milliseconds

setEnsureHttps()

Sets if HTTPS must be chosen over HTTP for this request

public setEnsureHttps(mixed $ensure_https) : mixed
Parameters
$ensure_https : mixed
Return values
mixed

setTimeout()

Sets request timeout

public setTimeout(mixed $timeout) : mixed
Parameters
$timeout : mixed
Return values
mixed

Search results