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

Public Member Functions

 __construct ($src=null, $stripSlashes=false)
 
 Save ()
 
 MoveUp ()
 
 MoveDown ()
 
 Delete ()
 
 PostProgress ($account, $progressValue, &$newProgress=0, &$cannotRepeat=NULL)
 
- Public Member Functions inherited from DataClass
 Save ()
 
 Delete ()
 
 ToJson ()
 
 ToArray ()
 

Static Public Member Functions

static Load ($idApp=0, $limit=null, $offset=null, &$count=null, $returnArray=false)
 
static Prune ()
 
static LoadUserAchievements ($idAccount, $idApp=0)
 
- 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 = "Achievement"
 
 $Id = 0
 
 $IdApp = 0
 
 $Title = ""
 
 $Description = ""
 
 $UniqueRecords = 1
 
 $Position = 0
 

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 Achievement

Author
Skared Creations

Definition at line 10 of file Achievement.php.

Constructor & Destructor Documentation

◆ __construct()

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

Contructor

Definition at line 25 of file Achievement.php.

Member Function Documentation

◆ Delete()

Delete ( )

Delete the record from the database

Returns
bool Returns TRUE on success

Definition at line 157 of file Achievement.php.

◆ Load()

static Load (   $idApp = 0,
  $limit = null,
  $offset = null,
$count = null,
  $returnArray = false 
)
static

Get the registered achievements

Parameters
string$idAppFilter IdApp
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
Achievement[] Returns the array of records

Definition at line 47 of file Achievement.php.

◆ LoadUserAchievements()

static LoadUserAchievements (   $idAccount,
  $idApp = 0 
)
static

Load high scores list with rank, value and user data

Parameters
int$idAccountAccount Id
Returns
array Highscore records list

Definition at line 187 of file Achievement.php.

◆ MoveDown()

MoveDown ( )

Definition at line 123 of file Achievement.php.

◆ MoveUp()

MoveUp ( )

Definition at line 97 of file Achievement.php.

◆ PostProgress()

PostProgress (   $account,
  $progressValue,
$newProgress = 0,
$cannotRepeat = NULL 
)

Post a progress in the achieveement from a user

Parameters
Account$accountAccount who scored
mixed$progressValueProgress value to save (0-100)
Returns
boolean Returns TRUE on success, otherwise FALSE

Definition at line 228 of file Achievement.php.

◆ Prune()

static Prune ( )
static

Delete all records associated to this class

Definition at line 176 of file Achievement.php.

◆ Save()

Save ( )

Save the record in the database

Returns
bool Returns TRUE on success

Definition at line 60 of file Achievement.php.

Field Documentation

◆ $Description

$Description = ""

Definition at line 17 of file Achievement.php.

◆ $Id

$Id = 0

Definition at line 14 of file Achievement.php.

◆ $IdApp

$IdApp = 0

Definition at line 15 of file Achievement.php.

◆ $Position

$Position = 0

Definition at line 19 of file Achievement.php.

◆ $Title

$Title = ""

Definition at line 16 of file Achievement.php.

◆ $UniqueRecords

$UniqueRecords = 1

Definition at line 18 of file Achievement.php.

◆ TABLE_NAME

const TABLE_NAME = "Achievement"

Definition at line 12 of file Achievement.php.