Pionia Core

Db
in package

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

$porm

The database query instance

private Porm $porm

Methods

__construct()

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()

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()

Returns the details of the current db connection

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

table()

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()

Sets up the database connection

public using([mixed $connection = 'default' ]) : Porm
Parameters
$connection : mixed = 'default'
Tags
throws
Exception
Return values
Porm

setup()

Sets up the database connection

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

        
On this page

Search results