StaticConventions
class StaticConventions extends Object implements IConventions
Conventions based on static definition.
Properties
protected string | $primary | ||
protected string | $foreign | ||
protected string | $table |
Methods
__construct($primary = 'id', $foreign = '%s_id', $table = '%s')
Create static conventional structure.
string|array|null
getPrimary($table)
Returns primary key for table.
array
getHasManyReference($table, $key)
Returns referenced table & referenced column.
array
getBelongsToReference($table, $key)
Returns referenced table & referencing column.
getColumnFromTable($name)
No description
Details
at line 35
__construct($primary = 'id', $foreign = '%s_id', $table = '%s')
Create static conventional structure.
at line 43
string|array|null
getPrimary($table)
Returns primary key for table.
at line 49
array
getHasManyReference($table, $key)
Returns referenced table & referenced column.
Example: (author, book) returns array(book, author_id)
at line 59
array
getBelongsToReference($table, $key)
Returns referenced table & referencing column.
Example (book, author) returns array(author, author_id) (book, translator) returns array(author, translator_id)
at line 69
protected
getColumnFromTable($name)
No description