Buddies
extends Model
in package
Buddies Class
Table of Contents
- $db : Database
- Contains the Database instance
- __construct() : mixed
- Constructor
- __destruct() : mixed
- Destructor
- checkIfBuddyExists() : string
- Check if the user exists
- getBuddiesByUserId() : array<string|int, mixed>
- getBuddiesDetailsForAcsById() : array<string|int, mixed>
- Get buddy details by ID
- getBuddyDataByBuddyId() : int
- Get buddy data by ID
- getBuddyDataById() : array<string|int, mixed>
- Get Buddy data by Id
- getBuddyIdByReceiverAndSender() : array<string|int, mixed>
- Get buddy ID based on receiver and sender, sort of validation
- insertNewBuddyRequest() : void
- Create a new buddy request
- removeBuddyById() : void
- Remove a buddy
- setBuddyStatusById() : void
- Confirm player as a current user buddy
- setNewDb() : void
- Creates a new Database object
Properties
$db
Contains the Database instance
protected
Database
$db
Methods
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —__destruct()
Destructor
public
__destruct() : mixed
Return values
mixed —checkIfBuddyExists()
Check if the user exists
public
checkIfBuddyExists(int $user_id) : string
Parameters
- $user_id : int
Return values
string —getBuddiesByUserId()
public
getBuddiesByUserId(int $user_id) : array<string|int, mixed>
Parameters
- $user_id : int
-
User ID
Return values
array<string|int, mixed> —getBuddiesDetailsForAcsById()
Get buddy details by ID
public
getBuddiesDetailsForAcsById(int $user_id, int $group_id) : array<string|int, mixed>
Parameters
- $user_id : int
- $group_id : int
Return values
array<string|int, mixed> —getBuddyDataByBuddyId()
Get buddy data by ID
public
getBuddyDataByBuddyId(int $buddy_id) : int
Parameters
- $buddy_id : int
-
Buddy ID
Return values
int —$buddy_id Buddy ID
getBuddyDataById()
Get Buddy data by Id
public
getBuddyDataById(int $user_id) : array<string|int, mixed>
Parameters
- $user_id : int
-
User ID
Return values
array<string|int, mixed> —getBuddyIdByReceiverAndSender()
Get buddy ID based on receiver and sender, sort of validation
public
getBuddyIdByReceiverAndSender(type $send_to, type $user_id) : array<string|int, mixed>
Parameters
- $send_to : type
- $user_id : type
Return values
array<string|int, mixed> —insertNewBuddyRequest()
Create a new buddy request
public
insertNewBuddyRequest(type $user, type $user_id, type $text) : void
Parameters
- $user : type
-
User ID
- $user_id : type
-
Current User ID
- $text : type
-
Request Text
Return values
void —removeBuddyById()
Remove a buddy
public
removeBuddyById(int $buddy_id, int $user_id) : void
Parameters
- $buddy_id : int
-
Buddy Id
- $user_id : int
-
Current User Id
Return values
void —setBuddyStatusById()
Confirm player as a current user buddy
public
setBuddyStatusById(int $buddy_id, int $user_id) : void
Parameters
- $buddy_id : int
-
Buddy Id
- $user_id : int
-
Current User Id
Return values
void —setNewDb()
Creates a new Database object
private
setNewDb() : void