Database
extends AbstractStorage
in package
Debug database storage class
Tags
Table of Contents
Properties
- $db : AbstractAdapter|null
- DB adapter
- $table : string
- Table
Methods
- __construct() : mixed
- Constructor
- clear() : void
- Clear all debug data
- getDb() : AbstractAdapter|null
- Get the current debug db adapter.
- getTable() : string
- Get the current debug db table.
- prepareEvents() : array<string|int, mixed>
- Prepare events
- save() : void
- Save debug data
- setDb() : Database
- Set the current debug db adapter.
- setTable() : Database
- Set the debug db table
- createTable() : void
- Create table in database
Properties
$db
DB adapter
protected
AbstractAdapter|null
$db
= null
$table
Table
protected
string
$table
= 'pop_debug'
Methods
__construct()
Constructor
public
__construct(AbstractAdapter $db[, string $table = 'pop_debug' ]) : mixed
Instantiate the DB writer object
The DB table requires the following fields at a minimum:
id INT
value TEXT, VARCHAR, etc.
Parameters
- $db : AbstractAdapter
- $table : string = 'pop_debug'
clear()
Clear all debug data
public
clear() : void
getDb()
Get the current debug db adapter.
public
getDb() : AbstractAdapter|null
Return values
AbstractAdapter|nullgetTable()
Get the current debug db table.
public
getTable() : string
Return values
stringprepareEvents()
Prepare events
public
prepareEvents(string $id, string $name, AbstractHandler $handler) : array<string|int, mixed>
Parameters
- $id : string
- $name : string
- $handler : AbstractHandler
Return values
array<string|int, mixed>save()
Save debug data
public
save(string $id, string $name, AbstractHandler $handler) : void
Parameters
- $id : string
- $name : string
- $handler : AbstractHandler
setDb()
Set the current debug db adapter.
public
setDb(AbstractAdapter $db) : Database
Parameters
- $db : AbstractAdapter
Return values
DatabasesetTable()
Set the debug db table
public
setTable(string $table) : Database
Parameters
- $table : string
Return values
DatabasecreateTable()
Create table in database
protected
createTable() : void