# |
Jan 30th 2014, 19:34 |
BackEndCoder |
but you are not |
# |
Jan 30th 2014, 19:34 |
BackEndCoder |
it would work if you are saving orders and items |
# |
Jan 30th 2014, 19:34 |
BackEndCoder |
then use that id to push the join table |
# |
Jan 30th 2014, 19:34 |
BackEndCoder |
you would save the order id like normal with your habtm |
# |
Jan 30th 2014, 19:33 |
BackEndCoder |
the model exsists, but cake writes it itself |
# |
Jan 30th 2014, 19:33 |
BackEndCoder |
its already there. but cake will default it |
# |
Jan 30th 2014, 19:33 |
BackEndCoder |
yes |
# |
Jan 30th 2014, 19:33 |
chris______ |
? |
# |
Jan 30th 2014, 19:33 |
chris______ |
which would be the join table |
# |
Jan 30th 2014, 19:32 |
chris______ |
so I need an extra entity called OrderItems |
# |
Jan 30th 2014, 19:32 |
chris______ |
I see |
# |
Jan 30th 2014, 19:32 |
BackEndCoder |
OrderItems |
# |
Jan 30th 2014, 19:32 |
BackEndCoder |
job done |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
and save it |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
so bind it |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
that will be a hasmany |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
you are saving the joining table |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
what you are doing isn't saving habtm |
# |
Jan 30th 2014, 19:31 |
todds |
The way that convo progressed made me think of itâ?¦ had to share. :) |
# |
Jan 30th 2014, 19:31 |
BackEndCoder |
chris______, |
# |
Jan 30th 2014, 19:30 |
BackEndCoder |
todds, damn them and thier jokes :D |
# |
Jan 30th 2014, 19:29 |
chris______ |
thats what I want to do |
# |
Jan 30th 2014, 19:29 |
chris______ |
1 | 3 |
# |
Jan 30th 2014, 19:29 |
chris______ |
1 | 2 |
# |
Jan 30th 2014, 19:29 |
chris______ |
1 | 1 |
# |
Jan 30th 2014, 19:29 |
chris______ |
order_id | item_id |
# |
Jan 30th 2014, 19:29 |
chris______ |
the relationship table would have rows like this: |
# |
Jan 30th 2014, 19:29 |
chris______ |
Since I am creating Order with ID = 1, and that order contains Items with IDs: 1, 2, 3 and 4; |
# |
Jan 30th 2014, 19:28 |
todds |
sorry, I can't offer any help, but i gotta share: http://xkcd.com/1323/ |
# |
Jan 30th 2014, 19:28 |
chris______ |
so your relationship table (N:M) would have IDs for both Order and Items, right? |
# |
Jan 30th 2014, 19:28 |
the-neon |
yeah |
# |
Jan 30th 2014, 19:27 |
chris______ |
ok lets suppose you have an Order, and in that Order you have Items, right? |
# |
Jan 30th 2014, 19:25 |
the-neon |
perhaps I'm a bit confused by my own assoc issue but I can't follow -_- |
# |
Jan 30th 2014, 19:23 |
chris______ |
quotation 1, product 1; quotation 1, product 2; quotation 1, product 3 |
# |
Jan 30th 2014, 19:23 |
the-neon |
1-2? |
# |
Jan 30th 2014, 19:22 |
chris______ |
that's what I want to do |
# |
Jan 30th 2014, 19:22 |
chris______ |
? |
# |
Jan 30th 2014, 19:22 |
chris______ |
cant i have rows like 1-2, 1-3, 1-4 |
# |
Jan 30th 2014, 19:22 |
chris______ |
but |
# |
Jan 30th 2014, 19:22 |
chris______ |
i see |
# |
Jan 30th 2014, 19:14 |
todds |
verbose correction |