OPEN SOURCE SOCIAL NETWORK 6.6
Loading...
Searching...
No Matches
OssnDatabase Class Reference
Inheritance diagram for OssnDatabase:
OssnBase OssnSession OssnComponents OssnEntities OssnLikes OssnNotifications OssnPoke OssnProfile OssnSearch OssnSite

Public Member Functions

 __construct ()
 
 Connect ()
 
 insert ($params)
 
 statement ($query)
 
 execute ($values=array())
 
 update ($params=array())
 
 select ($params, $multi='')
 
 fetch ($data=false)
 
 delete ($params)
 
 getLastEntry ()
 
 constructWheres (array $array, $operator="AND")
 
 generateLimit ($data_limit=false, $page_limit=false, $offset=false)
 
 clearVars ()
 
 __destruct ()
 
- Public Member Functions inherited from OssnBase
 getGUID ()
 
 getID ()
 
 getParam ($param)
 
 isParam ($param)
 
 __call ($method, $args)
 

Additional Inherited Members

- Static Public Member Functions inherited from OssnSession
static start ()
 
static assign ($name='', $value='')
 
static unassign ($name='')
 
static isSession ($name='')
 
static getSession ($name='')
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Initialize the database

return void

Reimplemented in OssnMessages.

◆ __destruct()

__destruct ( )

Unset the stuff that is not need once op is finished

Returns
void

Member Function Documentation

◆ clearVars()

clearVars ( )

Clear variables to avoid passing then in other objects

Returns
void

◆ Connect()

Connect ( )

Connect to database

Returns
boolean

◆ constructWheres()

constructWheres ( array  $array,
  $operator = "AND" 
)

Create a wheres clause for database

Parameters
array$arrayA valid array containg wheres clauses;
string$operatorAND, OR, LIKE
Returns
string

◆ delete()

delete (   $params)

Prepare a query to delete data from database

Parameters
string

param ['from'] Names of table

Parameters
array

param ['wheres'] Specify a selection criteria to get required records

Returns
boolean

Reimplemented in OssnComponents.

◆ execute()

execute (   $values = array())

Execute a mysqli query and store result in memory

Parameters
array$valuesValues
Returns
boolean

◆ fetch()

fetch (   $data = false)

Fetch the data from memory that is stored during execution;

Parameters
boolean$dataTure if you want to fetch all data , or false if only one row
Returns
boolean

◆ generateLimit()

generateLimit (   $data_limit = false,
  $page_limit = false,
  $offset = false 
)

Generate limit from options

Parameters
integer$data_limitHow much data should be fetched?
integer$page_limitLimit of data on one page
integer$offsetOffset value
Returns
string|false

◆ getLastEntry()

getLastEntry ( )

Get a guid of newly create entry

Returns
integer

◆ insert()

insert (   $params)

Prepare a query to insert data in database

Parameters
array

param ['names'] Names of columns

Parameters
array

param ['values'] Values that need to be inserted

Parameters
string

param ['into'] Table name

Returns
boolean

◆ select()

select (   $params,
  $multi = '' 
)

Prepare a query to select data from database

Parameters
string

param ['from'] Names of table

Parameters
array

param ['params'] Names of columns which you want to select

Parameters
array

param ['wheres'] Specify a selection criteria to get required records

Returns
boolean

◆ statement()

statement (   $query)

Prepare a database query

Returns
boolean

◆ update()

update (   $params = array())

Prepare a query to update data in database

Parameters
string

param ['names'] Names of columns

Parameters
array

param ['values'] Values that need to be updated

Parameters
string

param ['table'] Table name

Parameters
array

param ['wheres'] Specify a selection criteria to update required records

Returns
boolean

The documentation for this class was generated from the following file: