ConventionalReflection
class ConventionalReflection extends Object implements IReflection
Reflection metadata class for a database.
Properties
protected string | $primary | ||
protected string | $foreign | ||
protected string | $table |
Methods
__construct($primary = 'id', $foreign = '%s_id', $table = '%s')
Create conventional structure.
string|array
getPrimary($table)
Gets primary key of $table.
array
getHasManyReference($table, $key)
Gets referenced table & referenced column.
array
getBelongsToReference($table, $key)
Gets referenced table & referencing column.
getColumnFromTable($name)
No description
Details
at line 37
__construct($primary = 'id', $foreign = '%s_id', $table = '%s')
Create conventional structure.
at line 45
string|array
getPrimary($table)
Gets primary key of $table.
at line 51
array
getHasManyReference($table, $key)
Gets referenced table & referenced column.
Example: author, book returns array(book, author_id)
at line 61
array
getBelongsToReference($table, $key)
Gets referenced table & referencing column.
Example book, author returns array(author, author_id) book, translator returns array(author, translator_id)
at line 71
protected
getColumnFromTable($name)
No description