i'm struggling hours one...
i have buddy
object (entity) holds (should hold) preference
object. inside object have several collections of sub-objects. simplicity i'll explain 1 single sub-object. let's call university
. it's entity of own.
currently, buddy
, preference
have one-to-one association buddy
having database column preference_id
, preference
id
, nothing else. preference
, university
have many-to-many association, mapped doctrine buddy_preferences_universities
table preference_id
, univeristy_id
columns.
my goal establish association between buddy
, university
keeping described class hierarchy without need of useless preferences
table, i.e. still want able issue $unis = $buddy->getpreference()->getuniversities
, $unis
being university[]
collection.
so, possible "skip" preference
entity , map associations directly buddy_id
?
here's image of tables created doctrine's schema-tool
:
if necessary can post classes and/or xml mapping files.
thank you!
can not make buddy_preferences
table this:
id: char(36) university_id: char(36) country_id: char(36) interest_id: char(36)
like can drop 3 join tables.
now can $buddy->getpreference()->getuniversity();