This is indeed not supported by doctrine: any association with additional
data is more than an association: it's actually an entity.

Please also see http://stackoverflow.com/q/15616157/347063

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 21 January 2015 at 00:09, Veronique <[email protected]> wrote:

> I'm facing an issue with Doctrine associations with join tables.
>
> I have three entities: Location, Company and Vote. As you may presume, I'd
> like to make it possible to vote on both: location and company however I
> have no idea how to set up multiple oneToMany/manyToOne with join tables in
> Doctrine.
>
> Here's the database structure I'd like to achieve:
>
> companies
> companies_votes (company_id + vote_id)
> locations
> locations_votes (location_id + vote_id)
> votes
>
> I need bidirectional associations in my application as I need to access
> voted object in few places.
>
> According to Doctrine documentation
> <http://doctrine-orm.readthedocs.org/en/latest/reference/association-mapping.html#one-to-many-unidirectional-with-join-table>
>  it's
> not possible to set up bidirectional oneToMany association with join table.
> I've tried few configurations with joinTable option in my mapping file, but
> it's being ignored - the join table is not being created. If possible, I'd
> like to avoid creating 3rd entity for each association.
>
> Does anyone knows how to solve such issue?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to