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

Public Member Functions

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

Static Public Member Functions

static Load ($idAccount, $includeShared=false, $returnArray=false, $limit=NULL, $offset=NULL, &$count=NULL)
 
static LoadByUrl ($url)
 
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 = "UserFile"
 
 $Id = 0
 
 $IdAccount = 0
 
 $Name = ""
 
 $Url = ""
 
 $ShareType = SHARETYPE_EVERYBODY
 
 $Likes = 0
 
 $Views = 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 User Files

Author
Skared Creations

Definition at line 12 of file UserFile.php.

Constructor & Destructor Documentation

◆ __construct()

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

Contructor

Definition at line 28 of file UserFile.php.

Member Function Documentation

◆ AddLike()

AddLike ( )

Increments the Likes count

type $LoggedAccount

Returns
boolean Returns TRUE on success

Definition at line 152 of file UserFile.php.

◆ AddView()

AddView ( )

Increments the Views count

type $LoggedAccount

Returns
boolean Returns TRUE on success

Definition at line 184 of file UserFile.php.

◆ Delete()

Delete ( )

Delete the record from the database

Returns
bool Returns TRUE on success

Definition at line 114 of file UserFile.php.

◆ Load()

static Load (   $idAccount,
  $includeShared = false,
  $returnArray = false,
  $limit = NULL,
  $offset = NULL,
$count = NULL 
)
static

Get the registered files

Parameters
int$idAccountFilter IdAccount
boolean$includeSharedIf TRUE then it will include also the files shared by other users with the account
boolean$returnArrayIf TRUE then it will return associative arrays else objects
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
Returns
array Returns the array of records

Definition at line 52 of file UserFile.php.

◆ LoadByUrl()

static LoadByUrl (   $url)
static

Get a UserFile by Url

Database $Database

Parameters
string$urlFilter by Url
Returns
UserFile

Definition at line 69 of file UserFile.php.

◆ Prune()

static Prune ( )
static

Delete all records associated to this class $Database

Definition at line 138 of file UserFile.php.

◆ Save()

Save ( )

Save the record in the database

Returns
bool Returns TRUE on success

Definition at line 81 of file UserFile.php.

◆ ToArray()

ToArray ( )

Definition at line 215 of file UserFile.php.

◆ ToArrayClient()

ToArrayClient ( )

Definition at line 228 of file UserFile.php.

◆ ToJsonClient()

ToJsonClient ( )

Definition at line 234 of file UserFile.php.

Field Documentation

◆ $CustomData

$CustomData = ""

Definition at line 23 of file UserFile.php.

◆ $Id

$Id = 0

Definition at line 16 of file UserFile.php.

◆ $IdAccount

$IdAccount = 0

Definition at line 17 of file UserFile.php.

◆ $Likes

$Likes = 0

Definition at line 21 of file UserFile.php.

◆ $Name

$Name = ""

Definition at line 18 of file UserFile.php.

◆ $ShareType

$ShareType = SHARETYPE_EVERYBODY

Definition at line 20 of file UserFile.php.

◆ $Url

$Url = ""

Definition at line 19 of file UserFile.php.

◆ $Views

$Views = 0

Definition at line 22 of file UserFile.php.

◆ TABLE_NAME

const TABLE_NAME = "UserFile"

Definition at line 14 of file UserFile.php.