Database Class Reference

Database connection class. More...

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 disconnect ()
 Disconnect from the database.
 isConnected ()
 Return connection status.
 errorMsg ()
 Return database error message.
 checkTables ()
 Check system tables.

Private Member Functions

 createExtensionTable ($id_type)
 Create an extension table (if missing).
 getExtendedFieldList ($id_type)
 Get a field list for an extended view.
 createContentView ($id_type)
 Create a content view (if missing).
 createUserInfoView ()
 Create the user info view if missing.

Private Attributes

 $USERINFOID = 0
 special content `user info` id
 $db
 database handler
 $connected = FALSE
 TRUE if successfully connected.
 $dberrormsg
 last mysql error message


Detailed Description

Database connection class.

Definition at line 32 of file database.php.


Constructor & Destructor Documentation

Database::__construct (  ) 

Constructor.

Connect to the database.

Definition at line 44 of file database.php.


Member Function Documentation

Database::createExtensionTable ( id_type  )  [private]

Create an extension table (if missing).

Create a table _cnt_N where N is the specified content type id.

Type id = 0 is the special id used for extended user info.

Parameters:
id_type (int) content type id (0 --> user info)
Returns:
(boolean) TRUE if table successfully created

Definition at line 66 of file database.php.

Referenced by checkTables().

Database::getExtendedFieldList ( id_type  )  [private]

Get a field list for an extended view.

Get a useful field list to be used in a SQL view creation.

Parameters:
id_type (int) content type id (0 --> user info)
Returns:
(string) field list; if error (not critical) return a null string

Definition at line 98 of file database.php.

Referenced by createContentView(), and createUserInfoView().

Database::createContentView ( id_type  )  [private]

Create a content view (if missing).

Create a content view _cntview_N, where N is the specified content type id.

Parameters:
id_type (int) content type id

Definition at line 121 of file database.php.

References getExtendedFieldList().

Referenced by checkTables().

Database::createUserInfoView (  )  [private]

Create the user info view if missing.

Returns:
(boolean) TRUE if view successfully created

Definition at line 153 of file database.php.

References getExtendedFieldList().

Referenced by checkTables().

Database::disconnect (  ) 

Disconnect from the database.

Definition at line 175 of file database.php.

Database::isConnected (  ) 

Return connection status.

Returns:
(boolean) connection status

Definition at line 185 of file database.php.

Database::errorMsg (  ) 

Return database error message.

Returns:
(string) database error message

Definition at line 194 of file database.php.

Database::checkTables (  ) 

Check system tables.

Automatically build missing CMS-content tables and views.

TODO also check position order for contents (?)

Returns:
(boolean) TRUE if tables successfully checked

Definition at line 206 of file database.php.

References createContentView(), createExtensionTable(), and createUserInfoView().


Member Data Documentation

Database::$USERINFOID = 0 [private]

special content `user info` id

Definition at line 33 of file database.php.

Database::$db [private]

database handler

Definition at line 35 of file database.php.

Database::$connected = FALSE [private]

TRUE if successfully connected.

Definition at line 36 of file database.php.

Database::$dberrormsg [private]

last mysql error message

Definition at line 37 of file database.php.


The documentation for this class was generated from the following file:
Generated on Fri Feb 22 11:19:48 2008 for CMSkey by  doxygen 1.5.3