Well, I've decided to go with using a foreign key to identify
different agencies. I've created all my entities using
doctrine:generate:entity, so they are all present in the Entities
folder of my bundle. But now, when I try to use the
doctrine:schema:update command, it gives me an error!

"No Metadata Classes to process."

This was working before, why not now? I've tried clearing cache in
both Symfony and Doctrine, to no avail. My class looks like this:

/**
 * Vruum\TransitBundle\Entity\Location
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Vruum\TransitBundle\Entity
\LocationRepository")
 */
class Location
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;
...etc
}

On Feb 10, 1:48 pm, Richtermeister <nex...@gmail.com> wrote:
> Hey Jeremy,
>
> not sure about your setup. Seems to me like all routes and stops
> should be in just one table each and have a foreign key to the transit
> agency, so you can only ask for the relevant data..
> If you set proper indexes you should have no problem handling large
> amounts of data that way.
>
> Daniel
>
> On Feb 9, 9:03 pm, Jeremy Krygsman <jkrygs...@adigitalcity.com> wrote:
>
>
>
>
>
>
>
> > 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