Database
extends BaseCollector
in package
Collector for the Database tab of the Debug Toolbar.
Tags
Table of Contents
Properties
- $connections : array<string|int, mixed>
- Array of database connections.
- $hasLabel : bool
- Whether this collector needs to display a label or not.
- $hasTabContent : bool
- Whether this collector should display its own tab.
- $hasTimeline : bool
- Whether this collector has timeline data.
- $hasVarData : bool
- Whether this collector has data for the Vars tab.
- $queries : array<string|int, mixed>
- The query instances that have been collected through the DBQuery Event.
- $title : string
- The name used to reference this collector in the toolbar.
Methods
- __construct() : mixed
- Constructor
- cleanPath() : string
- This makes nicer looking paths for the error output.
- display() : array<string|int, mixed>|string
- Returns the data of this collector to be formatted in the toolbar
- getAsArray() : array<string|int, mixed>
- Return settings as an array.
- getBadgeValue() : int|null
- Gets the "badge" value for the button.
- getTitle() : string
- Gets the Collector's title.
- getTitleDetails() : string
- Information to be displayed next to the title.
- getVarData() : array<string|int, mixed>|null
- Gets a collection of data that should be shown in the 'Vars' tab.
- hasLabel() : bool
- Does this collector have a label?
- hasTabContent() : bool
- Does this collector need it's own tab?
- hasTimelineData() : bool
- Does this collector have information for the timeline?
- hasVarData() : bool
- Does this Collector have data that should be shown in the 'Vars' tab?
- icon() : string
- Display the icon.
- isEmpty() : bool
- Does this collector have any data collected?
- timelineData() : array<string|int, mixed>
- Grabs the data for the timeline, properly formatted, or returns an empty array.
- formatTimelineData() : array<string|int, mixed>
- Returns timeline data formatted for the toolbar.
- getConnections() : void
- Gets the connections from the database config
Properties
$connections
Array of database connections.
protected
array<string|int, mixed>
$connections
$hasLabel
Whether this collector needs to display a label or not.
protected
bool
$hasLabel
= false
$hasTabContent
Whether this collector should display its own tab.
protected
bool
$hasTabContent
= true
$hasTimeline
Whether this collector has timeline data.
protected
bool
$hasTimeline
= true
$hasVarData
Whether this collector has data for the Vars tab.
protected
bool
$hasVarData
= false
$queries
The query instances that have been collected through the DBQuery Event.
protected
static array<string|int, mixed>
$queries
= []
$title
The name used to reference this collector in the toolbar.
protected
string
$title
= 'Database'
Methods
__construct()
Constructor
public
__construct() : mixed
cleanPath()
This makes nicer looking paths for the error output.
public
cleanPath(string $file) : string
Use the dedicated clean_path()
function.
Parameters
- $file : string
Return values
stringdisplay()
Returns the data of this collector to be formatted in the toolbar
public
display() : array<string|int, mixed>|string
Return values
array<string|int, mixed>|stringgetAsArray()
Return settings as an array.
public
getAsArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getBadgeValue()
Gets the "badge" value for the button.
public
getBadgeValue() : int|null
Return values
int|nullgetTitle()
Gets the Collector's title.
public
getTitle([bool $safe = false ]) : string
Parameters
- $safe : bool = false
Return values
stringgetTitleDetails()
Information to be displayed next to the title.
public
getTitleDetails() : string
Return values
string —The number of queries (in parentheses) or an empty string.
getVarData()
Gets a collection of data that should be shown in the 'Vars' tab.
public
getVarData() : array<string|int, mixed>|null
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' ], ];
Return values
array<string|int, mixed>|nullhasLabel()
Does this collector have a label?
public
hasLabel() : bool
Return values
boolhasTabContent()
Does this collector need it's own tab?
public
hasTabContent() : bool
Return values
boolhasTimelineData()
Does this collector have information for the timeline?
public
hasTimelineData() : bool
Return values
boolhasVarData()
Does this Collector have data that should be shown in the 'Vars' tab?
public
hasVarData() : bool
Return values
boolicon()
Display the icon.
public
icon() : string
Icon from https://icons8.com - 1em package
Return values
stringisEmpty()
Does this collector have any data collected?
public
isEmpty() : bool
Return values
booltimelineData()
Grabs the data for the timeline, properly formatted, or returns an empty array.
public
timelineData() : array<string|int, mixed>
Return values
array<string|int, mixed>formatTimelineData()
Returns timeline data formatted for the toolbar.
protected
formatTimelineData() : array<string|int, mixed>
Return values
array<string|int, mixed> —The formatted data or an empty array.
getConnections()
Gets the connections from the database config
private
getConnections() : void