StaticConventions
class StaticConventions implements Conventions
Defines naming conventions for database structure using static patterns.
Methods
No description
Returns primary key for table.
Returns the referencing table name and referencing column for a has-many relationship.
Returns the referenced table name and local foreign key column for a belongs-to relationship.
No description
Details
at line 24
__construct(string $primary = 'id', string $foreign = '%s_id', string $table = '%s')
No description
at line 32
string|array|null
getPrimary(string $table)
Returns primary key for table.
at line 38
array|null
getHasManyReference(string $table, string $key)
Returns the referencing table name and referencing column for a has-many relationship.
Example: (author, book) returns [book, author_id]
at line 48
array|null
getBelongsToReference(string $table, string $key)
Returns the referenced table name and local foreign key column for a belongs-to relationship.
Example: (book, author) returns [author, author_id] (book, translator) returns [author, translator_id]
at line 58
protected string
getColumnFromTable(string $name)
No description