Zitadel PHP Client 1.3.6
PHP Client for Zitadel
Loading...
Searching...
No Matches
Create Class Reference

Public Member Functions

 __construct (array $settings)
 
 setUserId (string $userid)
 
 setUserName (string $username)
 
 setOrganization (int $orgId, string $orgDomain)
 
 setName (string $givenName, string $familyName)
 
 setNickName (string $nickName)
 
 setDisplayName (string $displayName)
 
 setLanguage (string $lang)
 
 setGender (string $gender)
 
 setEmail (string $email)
 
 setPhone (string $phone)
 
 addMetaData (string $key, string $value)
 
 setPassword (string $password, bool $changeRequired)
 
 addIDPLink (int $idpId, string $userId, string $userName)
 
 create ()
 

Detailed Description

Class to create a new user.

Definition at line 10 of file Create.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array $settings)

Initialize the user creation

Parameters
$settingsarray The settings array

Definition at line 36 of file Create.php.

Member Function Documentation

◆ addIDPLink()

addIDPLink ( int $idpId,
string $userId,
string $userName )

Add an Identity Provider to the User-Profile, so the user can sign in through e.g. Google or GitHub (optional). To get the required data to link an IDP, use the IDP class.

Parameters
$idpIdint The ID of the Identity Provider
$userIdstring The user id you get from the Identity Provider
$userNamestring The username you get from the Identity Provider
Returns
void

Definition at line 167 of file Create.php.

◆ addMetaData()

addMetaData ( string $key,
string $value )

Add Metadata to the user Profile (optional). The value will be automatically Base64 encoded.

Parameters
$keystring Key
$valuestring Value
Returns
void

Definition at line 143 of file Create.php.

◆ create()

create ( )

Create the new user and sends the data to Zitadel

Returns
void
Exceptions
ExceptionReturns an exception with an error code and a message if the communication with Zitadel fails

Definition at line 179 of file Create.php.

◆ setDisplayName()

setDisplayName ( string $displayName)

Set display name (optional)

Parameters
$displayNamestring Display name
Returns
void

Definition at line 94 of file Create.php.

◆ setEmail()

setEmail ( string $email)

Set the Email address (required). The email address will automatically marked as verified.

Parameters
$emailstring Email address
Returns
void

Definition at line 123 of file Create.php.

◆ setGender()

setGender ( string $gender)

Set the gender of the new user (optional).

Parameters
$genderstring Default: GENDER_UNSPECIFIED, Possible values: GENDER_MALE, GENDER_FEMALE, GENDER_DIVERSE
Returns
void

Definition at line 111 of file Create.php.

◆ setLanguage()

setLanguage ( string $lang)

Set the preferred user language (optional). If you don't set one, the default language will be used.

Parameters
$langstring Shortcode of the language, e.g. "en" or "de"
Returns
void

Definition at line 103 of file Create.php.

◆ setName()

setName ( string $givenName,
string $familyName )

Set the full name of the new user (required)

Parameters
$givenNamestring Given Name
$familyNamestring Family Name
Returns
void

Definition at line 75 of file Create.php.

◆ setNickName()

setNickName ( string $nickName)

Set the nickname (optional)

Parameters
$nickNamestring Nickname
Returns
void

Definition at line 85 of file Create.php.

◆ setOrganization()

setOrganization ( int $orgId,
string $orgDomain )

Set the organization membership of the new user

Parameters
$orgIdint Organization-Id
$orgDomainstring Organization-Domain
Returns
void

Definition at line 64 of file Create.php.

◆ setPassword()

setPassword ( string $password,
bool $changeRequired )

Set a password for the new user account (required)

Parameters
$passwordstring The password
$changeRequiredbool If a change is required, the user have to set a new password at the next login.
Returns
void

Definition at line 156 of file Create.php.

◆ setPhone()

setPhone ( string $phone)

Set the phone number (optional). The phone number will be automatically marked as verified.

Parameters
$phonestring Phone number in the format with county code, e.g. "+491590123456"
Returns
void

Definition at line 132 of file Create.php.

◆ setUserId()

setUserId ( string $userid)

Set the user id of the new user (optional). If not set, you'll get one from Zitadel.

Parameters
$useridstring The user id of the new user
Returns
void

Definition at line 45 of file Create.php.

◆ setUserName()

setUserName ( string $username)

Set the username of the new user. If you don't set one, the email address will be used as username.

Parameters
$usernamestring The username of the new user
Returns
void

Definition at line 54 of file Create.php.


The documentation for this class was generated from the following file: