| |
| scriptlog:lib:core:dbinterface [2026/09/26 09:09] – admin admin | scriptlog:lib:core:dbinterface [2026/09/26 09:16] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Core Class | | | ''@category'' | Core Class | |
| | ''@author'' | M.Noermoehammad | | | ''@author'' | M.Noermoehammad | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| ======= Methods (12) ======= | ======= Methods (12) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''setDbConnection()'' | Set database connection. | 29 | | | public | ''setDbConnection()'' | Set database connection. | 29 | |
| | public | ''closeDbConnection()'' | Close database connection. | 34 | | | public | ''closeDbConnection()'' | Close database connection. | 34 | |
| | public | ''dbQuery()'' | Execute an SQL query. | 43 | | | public | ''dbQuery()'' | Execute an SQL query. | 43 | |
| | public | ''dbInsert()'' | Insert a new record. | 53 | | | public | ''dbInsert()'' | Insert a new record. | 53 | |
| | public | ''dbReplace()'' | Insert ... On Duplicate Key Update. | 65 | | | public | ''dbReplace()'' | Insert ... On Duplicate Key Update. | 65 | |
| | public | ''dbUpdate()'' | Update an existing record. | 75 | | | public | ''dbUpdate()'' | Update an existing record. | 75 | |
| | public | ''dbDelete()'' | Delete a record. | 85 | | | public | ''dbDelete()'' | Delete a record. | 85 | |
| | public | ''dbLastInsertId()'' | Get the last inserted ID. | 90 | | | public | ''dbLastInsertId()'' | Get the last inserted ID. | 90 | |
| | public | ''dbTransaction()'' | Start a transaction. | 95 | | | public | ''dbTransaction()'' | Start a transaction. | 95 | |
| | public | ''dbCommit()'' | Commit the current transaction. | 100 | | | public | ''dbCommit()'' | Commit the current transaction. | 100 | |
| | public | ''dbRollBack()'' | Rollback the current transaction. | 105 | | | public | ''dbRollBack()'' | Rollback the current transaction. | 105 | |
| | public | ''isConnected()'' | Check if a database connection is active. | 110 | | | public | ''isConnected()'' | Check if a database connection is active. | 110 | |
| |
| |
| Set database connection. | Set database connection. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$config'' | ''array'' | //required// | //none// | | | ''$config'' | ''array'' | //required// | //none// | |
| | ''$options'' | ''array'' | ''[]'' | //none// | | | ''$options'' | ''array'' | ''[]'' | //none// | |
| |
| **Returns:** ''void'' — void | **Returns:** ''void'' — void |
| Execute an SQL query. | Execute an SQL query. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$sql'' | ''string'' | //required// | //none// | | | ''$sql'' | ''string'' | //required// | //none// | |
| | ''$parameters'' | ''array'' | ''[]'' | //none// | | | ''$parameters'' | ''array'' | ''[]'' | //none// | |
| |
| **Returns:** ''(none declared)'' — \PDOStatement|false | **Returns:** ''(none declared)'' — \PDOStatement|false |
| Insert a new record. | Insert a new record. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$tablename'' | ''string'' | //required// | //none// | | | ''$tablename'' | ''string'' | //required// | //none// | |
| | ''$params'' | ''array'' | //required// | //none// | | | ''$params'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''bool'' — boolean | **Returns:** ''bool'' — boolean |
| Replace statement to Insert or Update row. The correct way to do REPLACE INTO | Replace statement to Insert or Update row. The correct way to do REPLACE INTO |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$tablename'' | ''string'' | //required// | //none// | | | ''$tablename'' | ''string'' | //required// | //none// | |
| | ''$params'' | ''array'' | //required// | //none// | | | ''$params'' | ''array'' | //required// | //none// | |
| | ''$updateParams'' | ''array'' | //required// | //none// | | | ''$updateParams'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''bool'' — boolean | **Returns:** ''bool'' — boolean |
| Update an existing record. | Update an existing record. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$tablename'' | ''string'' | //required// | //none// | | | ''$tablename'' | ''string'' | //required// | //none// | |
| | ''$params'' | ''array'' | //required// | //none// | | | ''$params'' | ''array'' | //required// | //none// | |
| | ''$where'' | ''array'' | //required// | //none// | | | ''$where'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''int'' — int | **Returns:** ''int'' — int |
| Delete a record. | Delete a record. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$tablename'' | ''string'' | //required// | //none// | | | ''$tablename'' | ''string'' | //required// | //none// | |
| | ''$where'' | ''array'' | //required// | //none// | | | ''$where'' | ''array'' | //required// | //none// | |
| | ''$limit'' | ''?int'' | ''null'' | default null | | | ''$limit'' | ''?int'' | ''null'' | default null | |
| |
| **Returns:** ''int'' — int | **Returns:** ''int'' — int |