Kotchasan

Schema
in package

Database schema class

This class is responsible for retrieving and managing database schema information.

Tags
see
https://www.kotchasan.com/

Table of Contents

$db  : Driver
Database object
$tables  : array<string|int, mixed>
List of loaded schemas
create()  : static
Create Schema Class
fields()  : array<string|int, mixed>
Get the field names of a table
init()  : mixed
Initialize the schema data for a table

Properties

$tables

List of loaded schemas

private array<string|int, mixed> $tables = []

Methods

create()

Create Schema Class

public static create(Driver $db) : static
Parameters
$db : Driver

The database driver object

Return values
static

fields()

Get the field names of a table

public fields(string $table) : array<string|int, mixed>

Retrieve all field names in the specified table.

Parameters
$table : string

The table name

Tags
throws
InvalidArgumentException

if the table name is empty

Return values
array<string|int, mixed>

The array of field names

init()

Initialize the schema data for a table

private init(string $table) : mixed
Parameters
$table : string

The table name

Return values
mixed

Search results