LaunchDarkly PHP SDK 3.7.2

LDUserBuilder

A builder for constructing LDUser objects.

Note that all user attributes, except for key and anonymous, can be designated as private so that they will not be sent back to LaunchDarkly. You can do this either on a per-user basis in LDUserBuilder, or globally via the private_attribute_names and all_attributes_private options in the client configuration.

Table of Contents

__construct() Creates a builder with the specified key. LDUserBuilder
secondary() Sets the user's secondary key attribute. LDUserBuilder
privateSecondary() Sets the user's secondary key attribute, and marks it as private. LDUserBuilder
ip() Sets the user's IP address attribute. LDUserBuilder
privateIp() Sets the user's IP address attribute, and marks it as private. LDUserBuilder
country() Sets the user's country attribute. LDUserBuilder
privateCountry() Sets the user's country attribute, and marks it as private. LDUserBuilder
email() Sets the user's email address attribute. LDUserBuilder
privateEmail() Sets the user's email address attribute, and marks it as private. LDUserBuilder
name() Sets the user's full name attribute. LDUserBuilder
privateName() Sets the user's full name attribute, and marks it as private. LDUserBuilder
avatar() Sets the user's avatar URL attribute. LDUserBuilder
privateAvatar() Sets the user's avatar URL attribute, and marks it as private. LDUserBuilder
firstName() Sets the user's first name attribute. LDUserBuilder
privateFirstName() Sets the user's first name attribute, and marks it as private. LDUserBuilder
lastName() Sets the user's last name attribute. LDUserBuilder
privateLastName() Sets the user's last name attribute, and marks it as private. LDUserBuilder
anonymous() Sets whether this user is anonymous. LDUserBuilder
custom() Sets any number of custom attributes for the user. LDUserBuilder
customAttribute() Sets a single custom attribute for the user. LDUserBuilder
privateCustomAttribute() Sets a single custom attribute for the user, and marks it as private. LDUserBuilder
build() Creates the LDUser instance based on the builder's current properties. LDUser

Methods

secondary()

Sets the user's secondary key attribute.

public secondary( $secondary : string ) : LDUserBuilder
Parameters
$secondary : string

The secondary key

Return values
LDUserBuilder

the same builder

privateSecondary()

Sets the user's secondary key attribute, and marks it as private.

public privateSecondary( $secondary : string ) : LDUserBuilder
Parameters
$secondary : string

The secondary key

Return values
LDUserBuilder

the same builder

privateIp()

Sets the user's IP address attribute, and marks it as private.

public privateIp( $ip : string ) : LDUserBuilder
Parameters
$ip : string

The IP address

Return values
LDUserBuilder

the same builder

country()

Sets the user's country attribute.

public country( $country : string ) : LDUserBuilder

This may be an ISO 3166-1 country code, or any other value you wish; it is not validated.

Parameters
$country : string

The country

Return values
LDUserBuilder

the same builder

privateCountry()

Sets the user's country attribute, and marks it as private.

public privateCountry( $country : string ) : LDUserBuilder

This may be an ISO 3166-1 country code, or any other value you wish; it is not validated.

Parameters
$country : string

The country

Return values
LDUserBuilder

the same builder

email()

Sets the user's email address attribute.

public email( $email : string ) : LDUserBuilder
Parameters
$email : string

The email address

Return values
LDUserBuilder

the same builder

privateEmail()

Sets the user's email address attribute, and marks it as private.

public privateEmail( $email : string ) : LDUserBuilder
Parameters
$email : string

The email address

Return values
LDUserBuilder

the same builder

privateName()

Sets the user's full name attribute, and marks it as private.

public privateName( $name : string ) : LDUserBuilder
Parameters
$name : string

The full name

Return values
LDUserBuilder

the same builder

privateAvatar()

Sets the user's avatar URL attribute, and marks it as private.

public privateAvatar( $avatar : string ) : LDUserBuilder
Parameters
$avatar : string

The avatar URL

Return values
LDUserBuilder

the same builder

firstName()

Sets the user's first name attribute.

public firstName( $firstName : string ) : LDUserBuilder
Parameters
$firstName : string

The first name

Return values
LDUserBuilder

the same builder

privateFirstName()

Sets the user's first name attribute, and marks it as private.

public privateFirstName( $firstName : string ) : LDUserBuilder
Parameters
$firstName : string

The first name

Return values
LDUserBuilder

the same builder

lastName()

Sets the user's last name attribute.

public lastName( $lastName : string ) : LDUserBuilder
Parameters
$lastName : string

The last name

Return values
LDUserBuilder

the same builder

privateLastName()

Sets the user's last name attribute, and marks it as private.

public privateLastName( $lastName : string ) : LDUserBuilder
Parameters
$lastName : string

The last name

Return values
LDUserBuilder

the same builder

anonymous()

Sets whether this user is anonymous.

public anonymous( $anonymous : bool ) : LDUserBuilder

The default is false.

Parameters
$anonymous : bool

True if the user should not appear on the LaunchDarkly dashboard

Return values
LDUserBuilder

the same builder

custom()

Sets any number of custom attributes for the user.

public custom( $custom : array ) : LDUserBuilder
Parameters
$custom : array

An associative array of custom attribute names and values.

Return values
LDUserBuilder

the same builder

customAttribute()

Sets a single custom attribute for the user.

public customAttribute( $customKey : string , $customValue : mixed ) : LDUserBuilder
Parameters
$customKey : string

The attribute name

$customValue : mixed

The attribute value

Return values
LDUserBuilder

the same builder

privateCustomAttribute()

Sets a single custom attribute for the user, and marks it as private.

public privateCustomAttribute( $customKey : string , $customValue : mixed ) : LDUserBuilder
Parameters
$customKey : string

The attribute name

$customValue : mixed

The attribute value

Return values
LDUserBuilder

the same builder

build()

Creates the LDUser instance based on the builder's current properties.

public build( ) : LDUser
Return values
LDUser

Search results