\Pop\Debug\StorageDb

Debug database storage class

Summary

Methods
Properties
Constants
__construct()
setFormat()
isPhp()
isJson()
getFormat()
save()
get()
has()
delete()
clear()
encodeValue()
decodeValue()
setDb()
getDb()
getTable()
setTable()
No public properties found
JSON
PHP
createTable()
$format
$db
$table
N/A
No private methods found
No private properties found
N/A

Constants

JSON

JSON = 'JSON'

Format constants

PHP

PHP = 'PHP'

Properties

$format

$format : string

Storage format (json, php or text)

Type

string

$table

$table : string

Table

Type

string

Methods

__construct()

__construct(\Pop\Db\Adapter\AbstractAdapter  $db, string  $format = 'text', string  $table = 'pop_debug') 

Constructor

Instantiate the DB writer object

The DB table requires the following fields at a minimum:

id    INT
value TEXT, VARCHAR, etc.

Parameters

\Pop\Db\Adapter\AbstractAdapter $db
string $format
string $table

isPhp()

isPhp() : boolean

Determine if the format is PHP

Returns

boolean

isJson()

isJson() : boolean

Determine if the format is JSON

Returns

boolean

getFormat()

getFormat() : string

Get the storage format

Returns

string

save()

save(string  $id, mixed  $value) : \Pop\Debug\Storage\Db

Save debug data

Parameters

string $id
mixed $value

Returns

\Pop\Debug\Storage\Db

get()

get(string  $id) : mixed

Get debug data

Parameters

string $id

Returns

mixed

has()

has(string  $id) : mixed

Determine if debug data exists

Parameters

string $id

Returns

mixed

delete()

delete(string  $id) : void

Delete debug data

Parameters

string $id

clear()

clear() : void

Clear all debug data

encodeValue()

encodeValue(mixed  $value) : string

Encode the value based on the format

Parameters

mixed $value

Throws

\Pop\Debug\Storage\Exception

Returns

string

decodeValue()

decodeValue(mixed  $value) : mixed

Decode the value based on the format

Parameters

mixed $value

Returns

mixed

setDb()

setDb(string  $db) : \Pop\Debug\Storage\Db

Set the current debug db adapter.

Parameters

string $db

Returns

\Pop\Debug\Storage\Db

getTable()

getTable() : string

Get the current debug db table.

Returns

string

setTable()

setTable(string  $table) : \Pop\Debug\Storage\Db

Set the debug db table

Parameters

string $table

Returns

\Pop\Debug\Storage\Db

createTable()

createTable() : void

Create table in database