class DiscoveredConventions implements Conventions

Discovers database conventions based on table structure metadata.

Methods

__construct(Structure $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 20
__construct(Structure $structure)

No description

Parameters

Structure $structure

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

Returns primary key for table.

Parameters

string $table

Return Value

string|array|null

at line 36
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 89
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