# |
Jan 30th 2014, 19:55 |
BackEndCoder |
don't use null |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
if its not, its default |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
its overridden |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
if the row is there |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
yeah |
# |
Jan 30th 2014, 19:55 |
the-neon |
this is an override per customer |
# |
Jan 30th 2014, 19:55 |
the-neon |
Product model has a price field |
# |
Jan 30th 2014, 19:54 |
the-neon |
the product price is used |
# |
Jan 30th 2014, 19:54 |
BackEndCoder |
you just wouldn't have the association in the table |
# |
Jan 30th 2014, 19:54 |
the-neon |
if it's null it doesn't take it under account |
# |
Jan 30th 2014, 19:54 |
BackEndCoder |
you wouldn't want it to be null |
# |
Jan 30th 2014, 19:54 |
the-neon |
si senior |
# |
Jan 30th 2014, 19:54 |
BackEndCoder |
and if its null its the default price for the product ? |
# |
Jan 30th 2014, 19:54 |
BackEndCoder |
yeah thats what you want |
# |
Jan 30th 2014, 19:54 |
the-neon |
with id, customer_id, product_id, price ( can be null ) |
# |
Jan 30th 2014, 19:53 |
the-neon |
I've made a new model/table CustomPrice which belongsTo Customer, Product and on the other way it's hasMany |
# |
Jan 30th 2014, 19:53 |
BackEndCoder |
yeah its a hasthu assoc, matching the price each time |
# |
Jan 30th 2014, 19:53 |
todds |
the-neon -- another table for sureâ?¦unless you have 1 product. :) |
# |
Jan 30th 2014, 19:53 |
BackEndCoder |
a default? |
# |
Jan 30th 2014, 19:53 |
BackEndCoder |
how would you want to add a price for each customer tho >? |
# |
Jan 30th 2014, 19:52 |
BackEndCoder |
its like one of those |
# |
Jan 30th 2014, 19:52 |
BackEndCoder |
linking the customer to the new price |
# |
Jan 30th 2014, 19:52 |
the-neon |
isn't that what the hasmany:through is for based on the book? |
# |
Jan 30th 2014, 19:52 |
BackEndCoder |
you would have an extra table |
# |
Jan 30th 2014, 19:52 |
the-neon |
but... we have an extra field for each product per customer ( price ) |
# |
Jan 30th 2014, 19:52 |
BackEndCoder |
how you wish to manage that i don't know |
# |
Jan 30th 2014, 19:51 |
BackEndCoder |
to have a seperate price per product for each customer would be a habtm assoc |
# |
Jan 30th 2014, 19:50 |
BackEndCoder |
ACTION reads the-neon's question |
# |
Jan 30th 2014, 19:50 |
todds |
I speak Portuguese and sort of understand Spanishâ?¦ It would probably frustrate you to try to have a conversation with me in Spanish. :( |
# |
Jan 30th 2014, 19:50 |
the-neon |
BackEndCoder, did you see my question earlier? Perhaps you have a clue? |
# |
Jan 30th 2014, 19:49 |
DiegoHeras |
Becuase the codebook in Spanish is squishy |
# |
Jan 30th 2014, 19:49 |
DiegoHeras |
=/ |
# |
Jan 30th 2014, 19:49 |
BackEndCoder |
chris______, debug array go go go |
# |
Jan 30th 2014, 19:49 |
the-neon |
lol |
# |
Jan 30th 2014, 19:48 |
BackEndCoder |
P |
# |
Jan 30th 2014, 19:48 |
BackEndCoder |
anyone spanish in here ? |
# |
Jan 30th 2014, 19:48 |
DiegoHeras |
Could i ask you , if you know some Spanish guy who knows about cakePhp? |
# |
Jan 30th 2014, 19:48 |
BackEndCoder |
and this line $quotation = $this->Quotation->save($this->request->data); will only return a 1 or a 0, its not what you thought it was |
# |
Jan 30th 2014, 19:48 |
DiegoHeras |
Thank you! |
# |
Jan 30th 2014, 19:47 |
BackEndCoder |
a saveAll would be for multible orders |
# |
Jan 30th 2014, 19:47 |
BackEndCoder |
you don't want to use a saveAll here, as you only have one order |