Documentation

Db extends AbstractStorage
in package

Debug database storage class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
1.3.0

Table of Contents

JSON  = 'JSON'
Format constants
PHP  = 'PHP'
$db  : AbstractAdapter
DB adapter
$format  : string
Storage format (json, php or text)
$table  : string
Table
__construct()  : mixed
Constructor
clear()  : void
Clear all debug data
decodeValue()  : mixed
Decode the value based on the format
delete()  : void
Delete debug data
encodeValue()  : string
Encode the value based on the format
get()  : mixed
Get debug data
getDb()  : AbstractAdapter
Get the current debug db adapter.
getFormat()  : string
Get the storage format
getTable()  : string
Get the current debug db table.
has()  : mixed
Determine if debug data exists
isJson()  : bool
Determine if the format is JSON
isPhp()  : bool
Determine if the format is PHP
save()  : Db
Save debug data
setDb()  : Db
Set the current debug db adapter.
setFormat()  : AbstractStorage
Set the storage format
setTable()  : Db
Set the debug db table
createTable()  : void
Create table in database

Constants

Properties

$format

Storage format (json, php or text)

protected string $format = null

$table

Table

protected string $table = 'pop_debug'

Methods

__construct()

Constructor

public __construct(AbstractAdapter $db[, string $format = 'text' ][, 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
$format : string = 'text'
$table : string = 'pop_debug'
Return values
mixed

clear()

Clear all debug data

public clear() : void
Return values
void

decodeValue()

Decode the value based on the format

public decodeValue(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

delete()

Delete debug data

public delete(string $id) : void
Parameters
$id : string
Return values
void

encodeValue()

Encode the value based on the format

public encodeValue(mixed $value) : string
Parameters
$value : mixed
Tags
throws
Exception
Return values
string

get()

Get debug data

public get(string $id) : mixed
Parameters
$id : string
Return values
mixed

getFormat()

Get the storage format

public getFormat() : string
Return values
string

getTable()

Get the current debug db table.

public getTable() : string
Return values
string

has()

Determine if debug data exists

public has(string $id) : mixed
Parameters
$id : string
Return values
mixed

isJson()

Determine if the format is JSON

public isJson() : bool
Return values
bool

isPhp()

Determine if the format is PHP

public isPhp() : bool
Return values
bool

save()

Save debug data

public save(string $id, mixed $value) : Db
Parameters
$id : string
$value : mixed
Return values
Db

setDb()

Set the current debug db adapter.

public setDb(string $db) : Db
Parameters
$db : string
Return values
Db

setTable()

Set the debug db table

public setTable(string $table) : Db
Parameters
$table : string
Return values
Db

createTable()

Create table in database

protected createTable() : void
Return values
void

Search results