Combu Server  3.1.1
PHP API Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
DataClass Class Reference
Inheritance diagram for DataClass:
Account Account_App Account_Platform Achievement Achievement_User AdminAccount AppCustomData AppId CustomData Friend GameMail GameMatch GameMatch_Account GameMatch_CustomData GameMatch_Round Inventory IpBan LeaderBoard LeaderBoard_User News Newsletter NewsletterLog ServerSettings SessionToken Tournament Tournament_CustomData UserFile UserFileActivity UserGroup UserGroupAccount

Public Member Functions

 Save ()
 
 Delete ()
 
 ToJson ()
 
 ToArray ()
 

Static Public Member Functions

static GetTableName ($class)
 
static LoadRecords ($query, $returnedClass="")
 
static CountRecords ($tableName, $filter=null)
 
static TruncateTable ($tableName)
 
static TruncateClass ($class)
 

Protected Member Functions

 _loadFilter ($tableName, $filter)
 
 _loadByRow ($row, $stripSlashes=false, $callbackOnExists=false)
 
 _Delete ($tableName, $filter=null)
 

Static Protected Member Functions

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

Standard base class for database table classes

Definition at line 8 of file DataClass.php.

Member Function Documentation

◆ _count()

static _count (   $tableName,
  $filter = null 
)
staticprotected

Returns the records count from a query

Parameters
string$filterIf specified it is specified as WHERE clause (do not include 'WHERE')
Returns
int Records count

Definition at line 52 of file DataClass.php.

◆ _Delete()

_Delete (   $tableName,
  $filter = null 
)
protected

Delete a record from the table with the specified filter Database $Database

Parameters
string$tableNameTable name
string$filterClause WHERE
Returns
boolean TRUE on successful operation

Definition at line 166 of file DataClass.php.

◆ _load()

static _load (   $tableName,
  $returnedClass = "",
  $where = "",
  $order = null,
  $limit = null,
  $offset = null,
$count = null 
)
staticprotected

Load the records from a table with specified WHERE, ORDER and LIMIT clauses

Parameters
string$tableName
string$returnedClassThe class name to convert records, if empty then returns associative array
string$whereClause WHERE
string$orderClause ORDER BY
int$limitClause LIMIT count
int$offsetClause LIMIT offset
int$countIf not NULL then this will be set to total COUNT (no LIMIT clause)
Returns
array

Definition at line 80 of file DataClass.php.

◆ _loadByRow()

_loadByRow (   $row,
  $stripSlashes = false,
  $callbackOnExists = false 
)
protected

Initialize the current object from an associative array

Parameters
array$rowAssociative array to load

Definition at line 42 of file DataClass.php.

◆ _loadEx()

static _loadEx (   $select,
  $from,
  $returnedClass = "",
  $where = "",
  $order = null,
  $limit = null,
  $offset = null,
$count = null,
  $debug = false 
)
staticprotected

Definition at line 84 of file DataClass.php.

◆ _loadFilter()

_loadFilter (   $tableName,
  $filter 
)
protected

Load record data from a filter

Parameters
string$tableNameName of the table
string$filterFilter to apply

Definition at line 26 of file DataClass.php.

◆ _loadQuery()

static _loadQuery (   $query,
  $returnedClass = "" 
)
staticprotected

Definition at line 111 of file DataClass.php.

◆ CountRecords()

static CountRecords (   $tableName,
  $filter = null 
)
static

Count the records from a table with specified filter

Parameters
string$tableNameTable name
string$filterClause WHERE
Returns
int

Definition at line 139 of file DataClass.php.

◆ Delete()

Delete ( )

Delete the current object from database

Returns
boolean TRUE on successful operation

Definition at line 155 of file DataClass.php.

◆ GetTableName()

static GetTableName (   $class)
static

Definition at line 10 of file DataClass.php.

◆ LoadRecords()

static LoadRecords (   $query,
  $returnedClass = "" 
)
static

Load the records from a query

Parameters
string$queryStatement SQL
string$returnedClassClass name to convert the returned objects, if empty then returns associative arrays
Returns
array

Definition at line 129 of file DataClass.php.

◆ Save()

Save ( )

Save to database the current object

Returns
boolean TRUE on successful operation

Definition at line 147 of file DataClass.php.

◆ ToArray()

ToArray ( )

Definition at line 184 of file DataClass.php.

◆ ToJson()

ToJson ( )

Returns this object in JSON format

Returns
string The formatted object

Definition at line 180 of file DataClass.php.

◆ TruncateClass()

static TruncateClass (   $class)
static

Delete all records associated to a class

Definition at line 200 of file DataClass.php.

◆ TruncateTable()

static TruncateTable (   $tableName)
static

Delete all records from a table and resets the AUTOINCREMENT field $Database

Definition at line 192 of file DataClass.php.