Preferences
in package
Preferences Class
Tags
Table of Contents
- $current_user_id : int
- $preferences : array<string|int, mixed>
- __construct() : void
- Constructor
- getCurrentPreference() : PreferencesEntity
- Return current preference data
- getPreferences() : array<string|int, mixed>
- Get all the preferences
- isNickNameChangeAllowed() : bool
- Check if the username change is allowed
- isOwner() : bool
- Check if is the preference owner
- isVacationModeOn() : bool
- Check if the vacation mode is enabled
- isVacationModeRemovalAllowed() : bool
- Check if the vacation mode removal is allowed
- createNewPreferencesEntity() : PreferencesEntity
- Create a new instance of PreferencesEntity
- getUserId() : int
- Get the user id
- setUp() : void
- Set up the list of preferences
- setUserId() : void
- Set the user id
Properties
$current_user_id
private
int
$current_user_id
= 0
$preferences
private
array<string|int, mixed>
$preferences
= []
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $preferences, int $current_user_id) : void
Parameters
- $preferences : array<string|int, mixed>
- $current_user_id : int
Return values
void —getCurrentPreference()
Return current preference data
public
getCurrentPreference() : PreferencesEntity
Return values
PreferencesEntity —getPreferences()
Get all the preferences
public
getPreferences() : array<string|int, mixed>
Return values
array<string|int, mixed> —isNickNameChangeAllowed()
Check if the username change is allowed
public
isNickNameChangeAllowed() : bool
Return values
bool —isOwner()
Check if is the preference owner
public
isOwner() : bool
Return values
bool —isVacationModeOn()
Check if the vacation mode is enabled
public
isVacationModeOn() : bool
Return values
bool —isVacationModeRemovalAllowed()
Check if the vacation mode removal is allowed
public
isVacationModeRemovalAllowed() : bool
Return values
bool —createNewPreferencesEntity()
Create a new instance of PreferencesEntity
private
createNewPreferencesEntity(array<string|int, mixed> $preference) : PreferencesEntity
Parameters
- $preference : array<string|int, mixed>
-
Preference
Return values
PreferencesEntity —getUserId()
Get the user id
private
getUserId() : int
Return values
int —setUp()
Set up the list of preferences
private
setUp(array<string|int, mixed> $preferences) : void
Parameters
- $preferences : array<string|int, mixed>
-
Preferences
Return values
void —setUserId()
Set the user id
private
setUserId(int $user_id) : void
Parameters
- $user_id : int
-
User Id