class DiscoveredConventions implements Conventions

Discovers database conventions based on table structure metadata.

Methods

__construct(IStructure $structure)

No description

string|array|null
getPrimary(string $table)

Returns primary key for table.

array|null
getHasManyReference(string $nsTable, string $key)

Finds the referencing table and column for a has-many relationship by searching structure metadata.

array|null
getBelongsToReference(string $table, string $key)

Finds the referenced table and local foreign key column for a belongs-to relationship.

Details

at line 19
__construct(IStructure $structure)

No description

Parameters

IStructure $structure

at line 25
string|array|null getPrimary(string $table)

Returns primary key for table.

Parameters

string $table

Return Value

string|array|null

at line 35
array|null getHasManyReference(string $nsTable, string $key)

Finds the referencing table and column for a has-many relationship by searching structure metadata.

Triggers structure rebuild if needed. Throws on ambiguous match.

Parameters

string $nsTable
string $key

Return Value

array|null

at line 88
array|null getBelongsToReference(string $table, string $key)

Finds the referenced table and local foreign key column for a belongs-to relationship.

Triggers structure rebuild if needed.

Parameters

string $table
string $key

Return Value

array|null