Hi everyone,

This is my first post on the group! I'm just getting started in
Symfony 2, and I'm really pleased so far, so thanks to everyone who is
involved in creating it.

I have a small challenge related to database interaction using
Doctrine. I have an application that currently uses many identical
sets of tables pertaining to multiple different transit agencies. Each
agency has similar information within the tables (for example, a
'routes' table and a 'stops' table), but I would like to keep each
agency's tables separate for data manageability reasons. The way I
would previously interact with the different tables in sql is by
adding an 'agency_id' prefix to the SELECT FROM query. For example:

'SELECT * FROM' . $agency_id . '_routes'

In this way, I'm able to easily access any agency's 'routes' table
without writing a unique query for each agency. With Doctrine, though,
the entities must be pre-defined in the Entity folder within php
classes, and you call these entities in the code with:

$route = new Route();

This doesn't seem to leave a lot of flexibility to use the same entity
declarations to access multiple, similar tables. Any ideas on how to
acheive that kind of flexibility? If I could just do something like:

$route = new Route($agency_id);

that would be great. But any suggestions would be greatly appreciated.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to