\CodeIgniter\Debug\Toolbar\CollectorsDatabase

Collector for the Database tab of the Debug Toolbar.

Summary

Methods
Properties
Constants
getTitle()
getTitleDetails()
hasTabContent()
hasLabel()
hasTimelineData()
timelineData()
hasVarData()
getVarData()
display()
cleanPath()
getBadgeValue()
isEmpty()
icon()
getAsArray()
__construct()
No public properties found
No constants found
formatTimelineData()
$hasTimeline
$hasTabContent
$hasLabel
$hasVarData
$title
$connections
$queries
N/A
No private methods found
No private properties found
N/A

Properties

$hasTimeline

$hasTimeline : boolean

Whether this collector has timeline data.

Type

boolean

$hasTabContent

$hasTabContent : boolean

Whether this collector should display its own tab.

Type

boolean

$hasLabel

$hasLabel : boolean

Whether this collector needs to display a label or not.

Type

boolean

$hasVarData

$hasVarData : boolean

Whether this collector has data for the Vars tab.

Type

boolean

$title

$title : string

The name used to reference this collector in the toolbar.

Used to name things in the toolbar HTML.

Type

string

$connections

$connections : array

Array of database connections.

Type

array

$queries

$queries : array

The query instances that have been collected through the DBQuery Event.

Type

array

Methods

getTitle()

getTitle(boolean  $safe = false) : string

Gets the Collector's title.

Parameters

boolean $safe

Returns

string

getTitleDetails()

getTitleDetails() : string

Information to be displayed next to the title.

Returns

string —

The number of queries (in parentheses) or an empty string.

hasTabContent()

hasTabContent() : boolean

Does this collector need it's own tab?

Returns

boolean

hasLabel()

hasLabel() : boolean

Does this collector have a label?

Returns

boolean

hasTimelineData()

hasTimelineData() : boolean

Does this collector have information for the timeline?

Returns

boolean

timelineData()

timelineData() : array

Grabs the data for the timeline, properly formatted, or returns an empty array.

Returns

array

hasVarData()

hasVarData() : boolean

Does this Collector have data that should be shown in the 'Vars' tab?

Returns

boolean

getVarData()

getVarData() : null

Gets a collection of data that should be shown in the 'Vars' tab.

The format is an array of sections, each with their own array of key/value pairs:

$data = [ 'section 1' => [ 'foo' => 'bar, 'bar' => 'baz' ], 'section 2' => [ 'foo' => 'bar, 'bar' => 'baz' ], ];

Returns

null

display()

display() : array

Returns the data of this collector to be formatted in the toolbar

Returns

array

cleanPath()

cleanPath(string  $file) : string

Clean Path

This makes nicer looking paths for the error output.

Parameters

string $file

Returns

string

getBadgeValue()

getBadgeValue() : integer

Gets the "badge" value for the button.

Returns

integer

isEmpty()

isEmpty() : boolean

Does this collector have any data collected?

If not, then the toolbar button won't get shown.

Returns

boolean

icon()

icon() : string

Display the icon.

Icon from https://icons8.com - 1em package

Returns

string

getAsArray()

getAsArray() : array

Return settings as an array.

Returns

array

__construct()

__construct() 

Constructor

formatTimelineData()

formatTimelineData() : array

Returns timeline data formatted for the toolbar.

Timeline data should be formatted into arrays that look like:

[ 'name' => 'Database::Query', 'component' => 'Database', 'start' => 10 // milliseconds 'duration' => 15 // milliseconds ]

Returns

array —

The formatted data or an empty array.