Connection
in package
implements
DatabaseDriverInterface
Table of Contents
Interfaces
Properties
- $application : PioniaApplication|null
- $dsn : string|null
- $logging : bool
- $pdo : PDO|null
- $prefix : string|null
- $testMode : bool
- $type : string
Methods
- connect() : static
- Establishes the database connection
- getApplication() : PioniaApplication|null
- Returns the application instance
- getDsn() : string|null
- Returns the DSN
- getPdo() : PDO|null
- Returns the PDO instance
- getPrefix() : string|null
- Returns the database table prefix we should use
- getType() : string
- Returns the database type we are connecting to
- isLogging() : bool
- Tell the core if we should log queries
- isTestMode() : bool
- Sets whether we are in test mode
- setApplication() : void
- setDsn() : void
- setLogging() : void
- setPdo() : void
- setPrefix() : void
- setTestMode() : void
- setType() : void
- __construct() : mixed
Properties
$application
protected
PioniaApplication|null
$application
$dsn
protected
string|null
$dsn
= null
$logging
protected
bool
$logging
= false
$pdo
protected
PDO|null
$pdo
$prefix
protected
string|null
$prefix
= null
$testMode
protected
bool
$testMode
= false
$type
protected
string
$type
= 'mysql'
Methods
connect()
Establishes the database connection
public
static connect(PioniaApplication|null $application[, null|string|array<string|int, mixed>|PDO $connection = 'default' ]) : static
Parameters
- $application : PioniaApplication|null
- $connection : null|string|array<string|int, mixed>|PDO = 'default'
Return values
staticgetApplication()
Returns the application instance
public
getApplication() : PioniaApplication|null
Return values
PioniaApplication|nullgetDsn()
Returns the DSN
public
getDsn() : string|null
Return values
string|nullgetPdo()
Returns the PDO instance
public
getPdo() : PDO|null
Return values
PDO|nullgetPrefix()
Returns the database table prefix we should use
public
getPrefix() : string|null
Return values
string|nullgetType()
Returns the database type we are connecting to
public
getType() : string
Return values
stringisLogging()
Tell the core if we should log queries
public
isLogging() : bool
Return values
boolisTestMode()
Sets whether we are in test mode
public
isTestMode() : bool
Return values
boolsetApplication()
public
setApplication(PioniaApplication|null $application) : void
Parameters
- $application : PioniaApplication|null
setDsn()
public
setDsn(string $dsn) : void
Parameters
- $dsn : string
setLogging()
public
setLogging(bool $logging) : void
Parameters
- $logging : bool
setPdo()
public
setPdo(PDO|null $pdo) : void
Parameters
- $pdo : PDO|null
setPrefix()
public
setPrefix(string $prefix) : void
Parameters
- $prefix : string
setTestMode()
public
setTestMode(bool $testMode) : void
Parameters
- $testMode : bool
setType()
public
setType(string $type) : void
Parameters
- $type : string
__construct()
private
__construct(PioniaApplication|null $application[, null|string|array<string|int, mixed>|PDO $connection = 'default' ]) : mixed
Parameters
- $application : PioniaApplication|null
- $connection : null|string|array<string|int, mixed>|PDO = 'default'