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

Public Member Functions

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

Static Public Member Functions

static Load ($idAccount, $returnArray=false)
 
static LoadOrCreate ($idAccount, $itemName, $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 = "Inventory"
 
 $Id = 0
 
 $IdAccount = 0
 
 $IdApp = 0
 
 $Name = ""
 
 $Quantity = 0
 
 $CustomData = ""
 

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 Inventory items

Author
Skared Creations

Definition at line 10 of file Inventory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Contructor

Definition at line 24 of file Inventory.php.

Member Function Documentation

◆ Delete()

Delete ( )

Delete the record from the database

Returns
bool Returns TRUE on success

Definition at line 121 of file Inventory.php.

◆ Load()

static Load (   $idAccount,
  $returnArray = false 
)
static

Get the registered inventory items

Parameters
string$idAccountFilter IdAccount
boolean$returnArrayIf TRUE then it will return associative arrays else objects AppId $AppId
Returns
array Returns the array of records

Definition at line 48 of file Inventory.php.

◆ LoadOrCreate()

static LoadOrCreate (   $idAccount,
  $itemName,
  $returnArray = false 
)
static

Get the registered inventory item or create it now $Database $AppId

Parameters
type$idAccount
type$itemName
type$returnArray
Returns

Definition at line 66 of file Inventory.php.

◆ Prune()

static Prune ( )
static

Delete all records associated to this class

Definition at line 131 of file Inventory.php.

◆ Save()

Save ( )

Save the record in the database $Database $AppId

Returns
bool Returns TRUE on success

Definition at line 90 of file Inventory.php.

Field Documentation

◆ $CustomData

$CustomData = ""

Definition at line 19 of file Inventory.php.

◆ $Id

$Id = 0

Definition at line 14 of file Inventory.php.

◆ $IdAccount

$IdAccount = 0

Definition at line 15 of file Inventory.php.

◆ $IdApp

$IdApp = 0

Definition at line 16 of file Inventory.php.

◆ $Name

$Name = ""

Definition at line 17 of file Inventory.php.

◆ $Quantity

$Quantity = 0

Definition at line 18 of file Inventory.php.

◆ TABLE_NAME

const TABLE_NAME = "Inventory"

Definition at line 12 of file Inventory.php.