[datamapper ORM] How do I add my own columns to the autogenerated m:m tables |
[eluser]macron[/eluser]
In order to do proper normalization to my data I need to add a column to the table made by datamapper ORM. As you can see from the models below I use the images table in two relations. One for news and one for teachers. So I cant add info to the images table that relates to the teachers relation only. What I want to do is add an imagetype to the relation between teacher and image. As shown in the code below a teacher has many images. I want a way to select a specific image related to teacher. One with a specific imagetype. In essens NF 2 stuff. So, how do I do this? Code: class Image_model Extends DataMapper This is my db: Code: CREATE TABLE `images` (
[eluser]WanWizard[/eluser]
Read the documentation on many to many relationships, join tables and join fields: http://datamapper.exitecms.org/pages/joinfields.html
[eluser]macron[/eluser]
Thank you. I guess I have to print the docs one day and read it from a-z. It seems that reading onscreen I miss a lot of info.
[eluser]WanWizard[/eluser]
I still don't know all ins and outs. And I maintain it... |
Welcome Guest, Not a member yet? Register Sign In |