| Next revision | Previous revision |
| scriptlog:lib:core:dao [2026/09/26 09:09] – admin admin | scriptlog:lib:core:dao [2026/09/26 09:34] (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 ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (5) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''protected'' | ''(untyped)'' | ''$dbc'' | | 27 | |
| | | ''protected'' | ''(untyped)'' | ''$sql'' | | 33 | |
| | | ''protected'' | ''(untyped)'' | ''$error'' | | 39 | |
| | | ''protected'' | ''(untyped)'' | ''$sanitizing'' | | 46 | |
| | | ''protected'' | ''(untyped)'' | ''$prefix'' | | 52 | |
| |
| ======= Methods (18) ======= | ======= Methods (18) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | (undocumented) | 54 | | | public | ''__construct()'' | (undocumented) | 54 | |
| | protected | ''table()'' | Get prefixed table name | 75 | | | protected | ''table()'' | Get prefixed table name | 75 | |
| | protected | ''setSQL()'' | setSQL | 86 | | | protected | ''setSQL()'' | setSQL | 86 | |
| | protected | ''findAll()'' | Find All records | 100 | | | protected | ''findAll()'' | Find All records | 100 | |
| | protected | ''findRow()'' | Find Single row record | 124 | | | protected | ''findRow()'' | Find Single row record | 124 | |
| | protected | ''findColumn()'' | Find Column | 148 | | | protected | ''findColumn()'' | Find Column | 148 | |
| | public | ''checkCountValue()'' | CheckCountValue function | 170 | | | public | ''checkCountValue()'' | CheckCountValue function | 170 | |
| | protected | ''create()'' | Create records | 191 | | | protected | ''create()'' | Create records | 191 | |
| | protected | ''modify()'' | Modify record | 204 | | | protected | ''modify()'' | Modify record | 204 | |
| | protected | ''deleteRecord()'' | deleteRecord() | 220 | | | protected | ''deleteRecord()'' | deleteRecord() | 220 | |
| | protected | ''replaceRecord()'' | replaceRecord() | 233 | | | protected | ''replaceRecord()'' | replaceRecord() | 233 | |
| | protected | ''callTransaction()'' | callTransaction | 243 | | | protected | ''callTransaction()'' | callTransaction | 243 | |
| | protected | ''callCommit()'' | callCommit | 253 | | | protected | ''callCommit()'' | callCommit | 253 | |
| | protected | ''callRollBack()'' | callRollBack | 263 | | | protected | ''callRollBack()'' | callRollBack | 263 | |
| | public | ''runInTransaction()'' | Run a callable inside a single database transaction. | 280 | | | public | ''runInTransaction()'' | Run a callable inside a single database transaction. | 280 | |
| | protected | ''closeConnection()'' | closeConnection | 300 | | | protected | ''closeConnection()'' | closeConnection | 300 | |
| | protected | ''lastId()'' | lastId | 311 | | | protected | ''lastId()'' | lastId | 311 | |
| | protected | ''filteringId()'' | Filter and sanitize input values | 325 | | | protected | ''filteringId()'' | Filter and sanitize input values | 325 | |
| |
| |
| Get prefixed table name | Get prefixed table name |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$table'' | ''(untyped)'' | //required// | //none// | | | ''$table'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| setSQL | setSQL |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$sql'' | ''(untyped)'' | //required// | //none// | | | ''$sql'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| getting array of rows | getting array of rows |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | ''array()'' | //none// | | | ''$data'' | ''array'' | ''array()'' | //none// | |
| | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | | | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — array<array-key, mixed> | **Returns:** ''(none declared)'' — array<array-key, mixed> |
| getting one row | getting one row |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | ''array()'' | //none// | | | ''$data'' | ''array'' | ''array()'' | //none// | |
| | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | | | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| getting single field value | getting single field value |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | ''array()'' | //none// | | | ''$data'' | ''array'' | ''array()'' | //none// | |
| | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | | | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — boolean false if no more rows | **Returns:** ''(none declared)'' — boolean false if no more rows |
| CheckCountValue function | CheckCountValue function |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | ''[]'' | //none// | | | ''$data'' | ''array'' | ''[]'' | //none// | |
| |
| **Returns:** ''int'' — int | **Returns:** ''int'' — int |
| Create records | Create records |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$table'' | ''(untyped)'' | //required// | //none// | | | ''$table'' | ''(untyped)'' | //required// | //none// | |
| | ''$params'' | ''(untyped)'' | //required// | //none// | | | ''$params'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Modify record | Modify record |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$table'' | ''(untyped)'' | //required// | //none// | | | ''$table'' | ''(untyped)'' | //required// | //none// | |
| | ''$params'' | ''(untyped)'' | //required// | //none// | | | ''$params'' | ''(untyped)'' | //required// | //none// | |
| | ''$where'' | ''(untyped)'' | //required// | //none// | | | ''$where'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| are removed; otherwise at most $limit rows are deleted. | are removed; otherwise at most $limit rows are deleted. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$table'' | ''(untyped)'' | //required// | //none// | | | ''$table'' | ''(untyped)'' | //required// | //none// | |
| | ''$where'' | ''(untyped)'' | //required// | //none// | | | ''$where'' | ''(untyped)'' | //required// | //none// | |
| | ''$limit'' | ''?int'' | ''1'' | Maximum rows to delete, or null to delete all | | | ''$limit'' | ''?int'' | ''1'' | Maximum rows to delete, or null to delete all | |
| |
| **Returns:** ''(none declared)'' — int Number of rows deleted | **Returns:** ''(none declared)'' — int Number of rows deleted |
| replaceRecord() | replaceRecord() |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$table'' | ''(untyped)'' | //required// | //none// | | | ''$table'' | ''(untyped)'' | //required// | //none// | |
| | ''$params'' | ''(untyped)'' | //required// | //none// | | | ''$params'' | ''(untyped)'' | //required// | //none// | |
| | ''$to'' | ''(untyped)'' | //required// | //none// | | | ''$to'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| deletion during GDPR erasure). Rolls back and rethrows on any Throwable. | deletion during GDPR erasure). Rolls back and rethrows on any Throwable. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$work'' | ''callable'' | //required// | The work to run inside the transaction | | | ''$work'' | ''callable'' | //required// | The work to run inside the transaction | |
| |
| **Returns:** ''(none declared)'' — mixed The callable's return value | **Returns:** ''(none declared)'' — mixed The callable's return value |
| Filter and sanitize input values | Filter and sanitize input values |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$sanitize'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | Sanitizer instance | | | ''$sanitize'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | Sanitizer instance | |
| | ''$str'' | ''(untyped)'' | //required// | Input value to filter | | | ''$str'' | ''(untyped)'' | //required// | Input value to filter | |
| | ''$type'' | ''(untyped)'' | //required// | Sanitization type ('sql' or 'xss') | | | ''$type'' | ''(untyped)'' | //required// | Sanitization type ('sql' or 'xss') | |
| |
| **Returns:** ''(none declared)'' — int|string Sanitized value as integer (sql) or string (xss) | **Returns:** ''(none declared)'' — int|string Sanitized value as integer (sql) or string (xss) |