Class DiscoveredConventions
Conventions based on database structure.
-
Nette\Database\Conventions\DiscoveredConventions
implements
Nette\Database\IConventions
Methods summary
public
|
|
public
string
|
#
getPrimary( string $table )
Returns primary key for table.
Returns primary key for table.
Parameters
Returns
string
Implementation of
|
public
array
|
#
getHasManyReference( string $nsTable, string $key )
Returns referenced table & referenced column. Example:
(author, book) returns array(book, author_id)
Returns referenced table & referenced column. Example: (author, book)
returns array(book, author_id)
Parameters
- $nsTable
string source table
- $key
string referencing key
Returns
array array(referenced table, referenced column)
Throws
Implementation of
|
public
array
|
#
getBelongsToReference( string $table, string $key )
Returns referenced table & referencing column. Example
(book, author) returns array(author, author_id)
(book, translator) returns array(author, translator_id)
Returns referenced table & referencing column. Example (book, author)
returns array(author, author_id) (book, translator) returns array(author,
translator_id)
Parameters
- $table
string source table
- $key
string referencing key
Returns
array array(referenced table, referencing column)
Implementation of
|