LaunchDarkly PHP SDK 4.2.3

LDUser
in package

Contains specific attributes of a user browsing your site.

The only mandatory property property is the key, which must uniquely identify each user. For authenticated users, this may be a username or e-mail address. For anonymous users, it could be an IP address or session ID.

Use LDUserBuilder to construct instances of this class.

Table of Contents

__construct()  : LDUser
Constructor for directly creating an instance.
getAnonymous()  : bool|null
getAvatar()  : string|null
getCountry()  : string|null
getCustom()  : array<string|int, mixed>|null
getEmail()  : string|null
getFirstName()  : string|null
getIP()  : string|null
getKey()  : string
getLastName()  : string|null
getName()  : string|null
getPrivateAttributeNames()  : array<string|int, mixed>|null
getSecondary()  : string|null
isKeyBlank()  : bool

Methods

__construct()

Constructor for directly creating an instance.

public __construct(string $key[, string|null $secondary = null ][, string|null $ip = null ][, string|null $country = null ][, string|null $email = null ][, string|null $name = null ][, string|null $avatar = null ][, string|null $firstName = null ][, string|null $lastName = null ][, bool|null $anonymous = null ][, array<string|int, mixed>|null $custom = [] ][, array<string|int, mixed>|null $privateAttributeNames = [] ]) : LDUser

It is preferable to use LDUserBuilder instead of this constructor.

Parameters
$key : string

Unique key for the user. For authenticated users, this may be a username or e-mail address. For anonymous users, this could be an IP address or session ID.

$secondary : string|null = null

An optional secondary identifier

$ip : string|null = null

The user's IP address (optional)

$country : string|null = null

The user's country, as an ISO 3166-1 alpha-2 code (e.g. 'US') (optional)

$email : string|null = null

The user's e-mail address (optional)

$name : string|null = null

The user's full name (optional)

$avatar : string|null = null

A URL pointing to the user's avatar image (optional)

$firstName : string|null = null

The user's first name (optional)

$lastName : string|null = null

The user's last name (optional)

$anonymous : bool|null = null

Whether this is an anonymous user

$custom : array<string|int, mixed>|null = []

Other custom attributes that can be used to create custom rules

$privateAttributeNames : array<string|int, mixed>|null = []
Return values
LDUser

getAnonymous()

public getAnonymous() : bool|null
Return values
bool|null

getAvatar()

public getAvatar() : string|null
Return values
string|null

getCountry()

public getCountry() : string|null
Return values
string|null

getCustom()

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

getEmail()

public getEmail() : string|null
Return values
string|null

getFirstName()

public getFirstName() : string|null
Return values
string|null

getIP()

public getIP() : string|null
Return values
string|null

getKey()

public getKey() : string
Return values
string

getLastName()

public getLastName() : string|null
Return values
string|null

getName()

public getName() : string|null
Return values
string|null

getPrivateAttributeNames()

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

getSecondary()

public getSecondary() : string|null
Return values
string|null

isKeyBlank()

public isKeyBlank() : bool
Return values
bool

Search results