Hello there,
I need to link two tables together, however the linked table type is
not fixed.
Exemple :
I've got a "bill" table, with fields like "price", "paid_date",
"customer_id", etc.
>From that table, I want a foreign key to link to the charged object,
so I can use something like :
$bill->getChargedObject()
However, different kind of objects can be charged. It could be a tool,
or a book, or anything else. Each of these have very specific fields.
(note : this is just an example, the real problem is more complex)
So I've created corresponding tables (tool, book), and I'v managed the
link like that :
propel:
bill:
paiment_date: date
charged_object_class: varchar(255)
charged_object_id: integer
The solution works pretty well, however, I've lost the power of
foreign keys, and the ability to use names in fixtures. Has anyone
already experienced this kind of solution ? I would be glad to here
some differents opinions here.
Best regards,
Thibault
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---