Menu

## Db
in package

Db.php : 28

Provides a basis for other query builders to base on.

### Table of Contents

#### Properties

$application : PioniaApplication
  The Pionia application instance
$connection : Connection
  The connection to use
$porm : Porm
  The database query instance

#### Methods

__construct() : mixed
  Setup the database connection
from() : Porm
  This sets the table to use
info() : array<string|int, mixed>
  Returns the details of the current db connection
logs() : Arrayable|null
table() : Porm
  This is for running queries in a containerised environment.
using() : Porm
  Sets up the database connection
setup() : void
  Sets up the database connection

### Properties

#### $application

Db.php : 33

The Pionia application instance

`private PioniaApplication $application`

#### $connection

Db.php : 39

The connection to use

`private Connection $connection`

#### $porm

Db.php : 44

The database query instance

`private Porm $porm`

### Methods

#### __construct()

Db.php : 49

Setup the database connection

`public __construct([PioniaApplication|null $application = null ][, Connection|null|string|array<string|int, mixed> $connection = 'default' ]) : mixed`

##### Parameters

$application : PioniaApplication|null = null
$connection : Connection|null|string|array<string|int, mixed> = 'default'

#### from()

Db.php : 109

This sets the table to use

`public from(string $table[, string|null $alias = null ][, string|null $using = null ]) : Porm`

##### Parameters

$table : string

  The table to use

$alias : string|null = null

  The alias to use

$using : string|null = null

##### Tags

throws
  Exception
example

          Table::from('user') // notice this here
            ->get(['last_name' => 'Pionia']);

##### Return values

Porm

#### info()

Db.php : 146

Returns the details of the current db connection

`public info() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### logs()

Db.php : 137
`public static logs() : Arrayable|null`

##### Return values

Arrayable|null

#### table()

Db.php : 132

This is for running queries in a containerised environment.

`public static table(string $table[, string|null $alias = null ][, string|null $using = null ]) : Porm`

This should be the preferred in frameworks like Pionia

##### Parameters

$table : string
$alias : string|null = null
$using : string|null = null

##### Tags

throws
  Exception
see
  from()

  if you are not using a container

since

  v1.0.9 This method was updated to handle containerised environments only and should be used in frameworks like Pionia

##### Return values

Porm

#### using()

Db.php : 89

Sets up the database connection

`public using([mixed $connection = 'default' ]) : Porm`

##### Parameters

$connection : mixed = 'default'

##### Tags

throws
  Exception

##### Return values

Porm

#### setup()

Db.php : 66

Sets up the database connection

`private setup([mixed $connection = 'default' ]) : void`

##### Parameters

$connection : mixed = 'default'

## Search results