The Singleton Instance Method
Returns the sole instance of the DatabaseManager class. If it has not been created yet, it will create the object and then initialize it.
Tags:
The Static Query Method
The query static method handles the database query. It calls an internal method to do the work.
DatabaseManager::query expects the SQL for the query as it's only parameter.
Returns the results of mysql_query based on the SQL provided.
Tags:
Parameters:
void execute_query(
$sql)
|
|
The Private Execute Query
The private execute_query method handles the actual call to mysql_query. It also triggers the observe() method before the actual database call so that if it fails you will be able to see what the last query you made was.
execute_query expects the SQL for the query as it's only parameter.
Returns the results of mysql_query based on the SQL provided.
Tags:
Parameters:
DatabaseManager Initialization
The initialization method sets up the database connection. If the connection fails, it throws an error. This method also assigns any default observers to the observer array. By default it uses the SystemObserver which will record all database queries into the system.log.
execute_query does not accept parameters.
Tags:
DatabaseManager observe
The private observe method loops through the array of observers and sends the requested sql to the Observer's call method.
execute_query does not accept parameters.
Tags:
Parameters: