IntegrationBase
in package
Base class integrations need to extend.
Tags
Table of Contents
Properties
- $_icon : string
- $_language : Language
- $_name : string
- $_order : int|null
- $_settings : string|null
- $_data : IntegrationData
- $_db : DB
- $_errors : array<string|int, mixed>
Methods
- __construct() : mixed
- addError() : void
- Add an error to the errors array.
- afterRegistrationValidation() : mixed
- Called after registration validation.
- allowLinking() : bool
- Should we allow linking with this integration?
- beforeRegistrationValidation() : mixed
- Called before registration validation.
- data() : IntegrationData
- Get the integration data.
- getErrors() : array<string|int, mixed>
- Get any errors from the functions given by this integration.
- getIcon() : string
- Get the icon of this integration.
- getLanguage() : Language
- Get language.
- getName() : string
- Get the name of this integration.
- getOrder() : int
- Get the display order of this integration.
- getSettings() : string
- Get the settings path for this integration.
- isEnabled() : bool
- Get if this integration is enabled.
- onLinkRequest() : mixed
- Called when user wants to link their account from user connections page, Does not need to be verified.
- onRegistrationPageLoad() : mixed
- Called when register page being loaded.
- onSuccessfulVerification() : mixed
- Called when the user have successfully validated the ownership of the account.
- onUnlinkRequest() : mixed
- Called when user wants to unlink their integration user from connections page.
- onVerifyRequest() : mixed
- Called when user wants to continue to verify their integration user from connections page.
- successfulRegistration() : mixed
- Called when user is successfully registered.
- syncIntegrationUser() : bool
- Called when user integration is requested to be synced.
- validateIdentifier() : bool
- Validate identifier when it being linked or updated.
- validateUsername() : bool
- Validate username when it being linked or updated.
Properties
$_icon
protected
string
$_icon
$_language
protected
Language
$_language
$_name
protected
string
$_name
$_order
protected
int|null
$_order
$_settings
protected
string|null
$_settings
= \null
$_data
private
IntegrationData
$_data
$_db
private
DB
$_db
$_errors
private
array<string|int, mixed>
$_errors
= []
Methods
__construct()
public
__construct() : mixed
addError()
Add an error to the errors array.
public
addError(string $error) : void
Parameters
- $error : string
-
The error message
afterRegistrationValidation()
Called after registration validation.
public
abstract afterRegistrationValidation() : mixed
allowLinking()
Should we allow linking with this integration?
public
allowLinking() : bool
Return values
bool —Whether to allow linking with this integration
beforeRegistrationValidation()
Called before registration validation.
public
abstract beforeRegistrationValidation(Validate $validate) : mixed
Parameters
- $validate : Validate
data()
Get the integration data.
public
data() : IntegrationData
Return values
IntegrationData —This integration's data.
getErrors()
Get any errors from the functions given by this integration.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —Any errors
getIcon()
Get the icon of this integration.
public
getIcon() : string
Return values
string —Icon of integration.
getLanguage()
Get language.
public
getLanguage() : Language
Return values
Language —Get language
getName()
Get the name of this integration.
public
getName() : string
Return values
string —Name of integration.
getOrder()
Get the display order of this integration.
public
getOrder() : int
Return values
int —Display order of integration.
getSettings()
Get the settings path for this integration.
public
getSettings() : string
Return values
string —Integration settings path.
isEnabled()
Get if this integration is enabled.
public
isEnabled() : bool
Return values
bool —Check if integration is enabled
onLinkRequest()
Called when user wants to link their account from user connections page, Does not need to be verified.
public
abstract onLinkRequest(User $user) : mixed
Parameters
- $user : User
onRegistrationPageLoad()
Called when register page being loaded.
public
abstract onRegistrationPageLoad(Fields $fields) : mixed
Parameters
- $fields : Fields
onSuccessfulVerification()
Called when the user have successfully validated the ownership of the account.
public
abstract onSuccessfulVerification(IntegrationUser $integrationUser) : mixed
Parameters
- $integrationUser : IntegrationUser
onUnlinkRequest()
Called when user wants to unlink their integration user from connections page.
public
abstract onUnlinkRequest(User $user) : mixed
Parameters
- $user : User
onVerifyRequest()
Called when user wants to continue to verify their integration user from connections page.
public
abstract onVerifyRequest(User $user) : mixed
Parameters
- $user : User
successfulRegistration()
Called when user is successfully registered.
public
abstract successfulRegistration(User $user) : mixed
Parameters
- $user : User
syncIntegrationUser()
Called when user integration is requested to be synced.
public
abstract syncIntegrationUser(IntegrationUser $integration_user) : bool
Parameters
- $integration_user : IntegrationUser
Return values
boolvalidateIdentifier()
Validate identifier when it being linked or updated.
public
abstract validateIdentifier(string $identifier[, int $integration_user_id = 0 ]) : bool
Parameters
- $identifier : string
-
The identifier value to validate.
- $integration_user_id : int = 0
-
The integration user id to ignore during duplicate check.
Return values
bool —Whether this validation passed or not.
validateUsername()
Validate username when it being linked or updated.
public
abstract validateUsername(string $username[, int $integration_user_id = 0 ]) : bool
Parameters
- $username : string
-
The username value to validate.
- $integration_user_id : int = 0
-
The integration user id to ignore during duplicate check.
Return values
bool —Whether this validation passed or not.