Menu

## Db extends KBase
in package

Db.php : 22

Database base class

Provides the base functionality for database operations.

##### Tags

see
  https://www.kotchasan.com/

### Table of Contents

$cfg : object
  Config class instance.
$db : Driver
  Database connection.
$request : Request
  Server request class instance.
__construct() : mixed
  Class constructor.
db() : Driver
  Get the database connection.
getAllSettings() : object
  Get all database settings.
getSetting() : mixed
  Get the value of a database setting.

### Properties

#### $cfg

KBase.php : 26

Config class instance.

`protected static object $cfg`

#### $db

Db.php : 29

Database connection.

`protected Driver $db`

#### $request

KBase.php : 33

Server request class instance.

`protected static Request $request`

### Methods

#### __construct()

Db.php : 36

Class constructor.

`public __construct(string $conn) : mixed`

##### Parameters

$conn : string

  The connection name. If not specified, no database connection will be made.

##### Return values

mixed —

#### db()

Db.php : 46

Get the database connection.

`public db() : Driver`

##### Return values

Driver —

The database connection.

#### getAllSettings()

Db.php : 70

Get all database settings.

`public getAllSettings() : object`

##### Return values

object —

The database settings object.

#### getSetting()

Db.php : 58

Get the value of a database setting.

`public getSetting(string $key) : mixed`

##### Parameters

$key : string

  The setting key.

##### Return values

mixed —

The value of the setting.

## Search results