Combu Server  3.1.1
PHP API Documentation
Public Member Functions | Static Public Member Functions | Data Fields
GameMail Class Reference
Inheritance diagram for GameMail:
DataClass

Public Member Functions

 __construct ($src=null, $stripSlashes=false)
 
 Save ()
 
 Delete ()
 
 ToArray ()
 
 ToJson ()
 
- Public Member Functions inherited from DataClass
 Save ()
 
 Delete ()
 
 ToJson ()
 
 ToArray ()
 

Static Public Member Functions

static Load ($idAccount=0, $idSender=0, $idGroup=0, $unread=FALSE, $limit=null, $offset=null, &$count=null, $returnArray=false)
 
static LoadUnread ($idAccount, $idSenders=array(), $idGroups=array(), $returnArray=false)
 
static LoadConversations ($idAccount)
 
static LoadConversationMessages ($myAccount, $otherAccount, $idGroup, $limit=null, $offset=null, &$count=null, $returnArray=false)
 
static Prune ()
 
- Static Public Member Functions inherited from DataClass
static GetTableName ($class)
 
static LoadRecords ($query, $returnedClass="")
 
static CountRecords ($tableName, $filter=null)
 
static TruncateTable ($tableName)
 
static TruncateClass ($class)
 

Data Fields

const TABLE_NAME = "Mail"
 
 $Id = 0
 
 $IdAccount = 0
 
 $IdGroup = 0
 
 $IdSender = 0
 
 $IsPublic = 0
 
 $SendDate = ""
 
 $ReadDate = ""
 
 $Subject = ""
 
 $Message = ""
 

Additional Inherited Members

- Protected Member Functions inherited from DataClass
 _loadFilter ($tableName, $filter)
 
 _loadByRow ($row, $stripSlashes=false, $callbackOnExists=false)
 
 _Delete ($tableName, $filter=null)
 
- Static Protected Member Functions inherited from DataClass
static _count ($tableName, $filter=null)
 
static _load ($tableName, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null)
 
static _loadEx ($select, $from, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null, $debug=false)
 
static _loadQuery ($query, $returnedClass="")
 

Detailed Description

Class to handle in-game Mail

Author
Skared Creations

Definition at line 10 of file GameMail.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $src = null,
  $stripSlashes = false 
)

Contructor

Definition at line 27 of file GameMail.php.

Member Function Documentation

◆ Delete()

Delete ( )

Delete the record from the database

Returns
boolean Returns TRUE on success

Definition at line 173 of file GameMail.php.

◆ Load()

static Load (   $idAccount = 0,
  $idSender = 0,
  $idGroup = 0,
  $unread = FALSE,
  $limit = null,
  $offset = null,
$count = null,
  $returnArray = false 
)
static

Get the registered messages

Parameters
int$idAccountFilter IdAccount (recipient)
int$idSenderFilter IdSender (sender)
int$idGroupFilter IdGroup (multiple recipients)
boolean$unreadFilter unread
int$limitMax number of results (for paged results)
int$offsetOffset number of results (for paged results)
int$countWill be set to the total count of results
boolean$returnArrayIf TRUE then it will return associative arrays else objects
Returns
[] Returns the array of records

Definition at line 53 of file GameMail.php.

◆ LoadConversationMessages()

static LoadConversationMessages (   $myAccount,
  $otherAccount,
  $idGroup,
  $limit = null,
  $offset = null,
$count = null,
  $returnArray = false 
)
static

Get the registered messages

Parameters
int$myAccountFilter the owner account Id of the request (recipient or sender)
int$idGroupFilter IdGroup (multiple recipients)
int$limitMax number of results (for paged results)
int$offsetOffset number of results (for paged results)
int$countWill be set to the total count of results
boolean$returnArrayIf TRUE then it will return associative arrays else objects
Returns
array Returns the array of records

Definition at line 120 of file GameMail.php.

◆ LoadConversations()

static LoadConversations (   $idAccount)
static

Get the conversations senders as array of users and groups

Parameters
int$idAccount
Returns
array Array of Account and UserGroup

Definition at line 89 of file GameMail.php.

◆ LoadUnread()

static LoadUnread (   $idAccount,
  $idSenders = array(),
  $idGroups = array(),
  $returnArray = false 
)
static

Get the messages sent to a user marked as unread

Parameters
int$idAccountFilter the recipient
Returns
[]

Definition at line 75 of file GameMail.php.

◆ Prune()

static Prune ( )
static

Delete all records associated to this class

Definition at line 182 of file GameMail.php.

◆ Save()

Save ( )

Save the record in the database Database $Database

Returns
boolean Returns TRUE on success

Definition at line 137 of file GameMail.php.

◆ ToArray()

ToArray ( )

Definition at line 186 of file GameMail.php.

◆ ToJson()

ToJson ( )

Definition at line 199 of file GameMail.php.

Field Documentation

◆ $Id

$Id = 0

Definition at line 14 of file GameMail.php.

◆ $IdAccount

$IdAccount = 0

Definition at line 15 of file GameMail.php.

◆ $IdGroup

$IdGroup = 0

Definition at line 16 of file GameMail.php.

◆ $IdSender

$IdSender = 0

Definition at line 17 of file GameMail.php.

◆ $IsPublic

$IsPublic = 0

Definition at line 18 of file GameMail.php.

◆ $Message

$Message = ""

Definition at line 22 of file GameMail.php.

◆ $ReadDate

$ReadDate = ""

Definition at line 20 of file GameMail.php.

◆ $SendDate

$SendDate = ""

Definition at line 19 of file GameMail.php.

◆ $Subject

$Subject = ""

Definition at line 21 of file GameMail.php.

◆ TABLE_NAME

const TABLE_NAME = "Mail"

Definition at line 12 of file GameMail.php.