OssnDatabase Class Reference
Inheritance diagram for OssnDatabase:
OssnBase OssnComponents OssnEntities OssnSite OssnAnnotation OssnFile OssnObject OssnUser OssnThemes

Public Member Functions

 Connect ()
 
 insert ($params)
 
 statement ($query)
 
 execute ()
 
 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)
 
- Public Member Functions inherited from OssnBase
 getGUID ()
 
 getID ()
 
 getParam ($param)
 
 isParam ($param)
 

Detailed Description

Definition at line 12 of file OssnDatabase.php.

Member Function Documentation

Connect ( )

Connect to mysql database

Returns
boolean

Definition at line 18 of file OssnDatabase.php.

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

Definition at line 256 of file OssnDatabase.php.

delete (   $params)

Prepare a query to delete data from database

Parameters
arrayarray(); 'from' Names of table 'wheres' Specify a selection criteria to get required records
Returns
boolean

Definition at line 219 of file OssnDatabase.php.

execute ( )

Execute a mysqli query and store result in memory

Returns
boolean

Definition at line 70 of file OssnDatabase.php.

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

Definition at line 189 of file OssnDatabase.php.

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

Definition at line 272 of file OssnDatabase.php.

getLastEntry ( )

Get a guid of newly create entry

Returns
integer

Definition at line 243 of file OssnDatabase.php.

insert (   $params)

Prepare a query to insert data in database

Parameters
arrayarray(); 'names' Names of columns 'values' Values that need to be inserted 'into' Table name
Returns
boolean

Definition at line 37 of file OssnDatabase.php.

select (   $params,
  $multi = '' 
)

Prepare a query to select data from database

Parameters
arrayarray(); 'from' Names of table 'params' Names of columns which you want to select 'wheres' Specify a selection criteria to get required records
Returns
boolean

Definition at line 139 of file OssnDatabase.php.

statement (   $query)

Prepare a mysqli query

Returns
boolean

Definition at line 57 of file OssnDatabase.php.

update (   $params = array())

Prepare a query to update data in database

Parameters
arrayarray(); 'names' Names of columns 'values' Values that need to be updated 'table' Table name 'wheres' Specify a selection criteria to update required records
Returns
boolean

Definition at line 100 of file OssnDatabase.php.


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