
Provides fSchema class related functions for ORM code
1.0.0b9 | Enhanced various exception messages 9/19/10 |
---|---|
1.0.0b8 | Added 'one-to-one' support to getRouteNameFromRelationship(), '!many-to-one' to getRoute() 3/3/10 |
1.0.0b7 | Added support for multiple databases 10/28/09 |
1.0.0b6 | Internal Backwards Compatibility Break - Added the $schema parameter to the beginning of getRoute(), getRouteName(), getRoutes() and isOneToOne() - added '!many-to-one' relationship type handling 10/22/09 |
1.0.0b5 | Fixed some error messaging to not include {empty_string} in some situations 7/31/09 |
1.0.0b4 | Added isOneToOne() 7/21/09 |
1.0.0b3 | Added routes caching for performance 6/15/09 |
1.0.0b2 | Backwards Compatiblity Break - removed enableSmartCaching(), fORM::enableSchemaCaching() now provides equivalent functionality 5/4/09 |
1.0.0b | The initial implementation 6/14/07 |
Allows attaching an fSchema-compatible object as the schema singleton for ORM code
void attach( fSchema $schema, string $name='default' )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns information about the specified route
void getRoute( fSchema $schema, string $table, string $related_table, string $route, string $relationship_type=NULL )
fSchema | $schema | The schema object to get the route from |
string | $table | The main table we are searching on behalf of |
string | $related_table | The related table we are searching under |
string | $route | The route to get info about |
string | $relationship_type | The relationship type: NULL, '*-to-many', '*-to-one', '!many-to-one', 'one-to-one', 'one-to-meny', 'many-to-one', 'many-to-many' |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns the name of the only route from the specified table to one of its related tables
string getRouteName( fSchema $schema, string $table, string $related_table, string $route=NULL, string $relationship_type=NULL )
fSchema | $schema | The schema object to get the route name from |
string | $table | The main table we are searching on behalf of |
string | $related_table | The related table we are trying to find the routes for |
string | $route | The route that was preselected, will be verified if present |
string | $relationship_type | The relationship type: NULL, '*-to-many', '*-to-one', '!many-to-one', 'one-to-one', 'one-to-many', 'many-to-one', 'many-to-many' |
The only route from the main table to the related table
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns the name of the route specified by the relationship
string getRouteNameFromRelationship( string $type, array $relationship )
string | $type | The type of relationship: '*-to-one', 'one-to-one', 'one-to-many', 'many-to-one', 'many-to-many' |
array | $relationship | The relationship array from fSchema::getKeys() |
The name of the route
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns an array of all routes from a table to one of its related tables
array getRoutes( fSchema $schema, string $table, string $related_table, string $relationship_type=NULL )
fSchema | $schema | The schema object to get the routes for |
string | $table | The main table we are searching on behalf of |
string | $related_table | The related table we are trying to find the routes for |
string | $relationship_type | The relationship type: NULL, '*-to-many', '*-to-one', '!many-to-one', 'one-to-one', 'one-to-many', 'many-to-one', 'many-to-many' |
All of the routes from the main table to the related table
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Indicates if the relationship specified is a one-to-one relationship
boolean isOneToOne( fSchema $schema, string $table, string $related_table, string $route=NULL )
fSchema | $schema | The schema object the tables are from |
string | $table | The main table we are searching on behalf of |
string | $related_table | The related table we are trying to find the routes for |
string | $route | The route between the two tables |
If the table is in a one-to-one relationship with the related table over the route specified
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Resets the configuration of the class
void reset( )