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 | |
Definition at line 32 of file database.php.
| Database::__construct | ( | ) |
| 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.
| id_type | (int) content type id (0 --> user info) |
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.
| id_type | (int) content type id (0 --> user info) |
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.
| 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.
Definition at line 153 of file database.php.
References getExtendedFieldList().
Referenced by checkTables().
| Database::disconnect | ( | ) |
| Database::isConnected | ( | ) |
Return connection status.
Definition at line 185 of file database.php.
| Database::errorMsg | ( | ) |
Return 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 (?)
Definition at line 206 of file database.php.
References createContentView(), createExtensionTable(), and createUserInfoView().
Database::$USERINFOID = 0 [private] |
Database::$db [private] |
Database::$connected = FALSE [private] |
Database::$dberrormsg [private] |
1.5.3