# |
Jan 30th 2014, 20:10 |
Nick____ |
Hi all, |
# |
Jan 30th 2014, 20:10 |
the-neon |
( |
# |
Jan 30th 2014, 20:10 |
the-neon |
id fields are int, price is decimal |
# |
Jan 30th 2014, 20:10 |
the-neon |
no validation rules |
# |
Jan 30th 2014, 20:09 |
todds |
so the save is returning false. are there any validation rules? also, check the data types for the table rows. |
# |
Jan 30th 2014, 20:08 |
the-neon |
I... get my error flash message |
# |
Jan 30th 2014, 20:08 |
todds |
I believe you need saveAll(). do you get an error? |
# |
Jan 30th 2014, 20:07 |
the-neon |
I had it at saveAll() then save() |
# |
Jan 30th 2014, 20:07 |
todds |
the-neon: are you doing save() or saveMany()? |
# |
Jan 30th 2014, 20:05 |
the-neon |
BackEndCoder: http://bin.cakephp.org/view/338066217 |
# |
Jan 30th 2014, 20:02 |
the-neon |
let me bin that for you |
# |
Jan 30th 2014, 20:02 |
the-neon |
the model exists |
# |
Jan 30th 2014, 20:01 |
BackEndCoder |
so say .. Article->save() will only save its cateogrys if its a Article hasMany Categories |
# |
Jan 30th 2014, 20:01 |
BackEndCoder |
the save() will only work if the model is naturall already associated with the model you are saving |
# |
Jan 30th 2014, 20:00 |
BackEndCoder |
and bin it |
# |
Jan 30th 2014, 20:00 |
BackEndCoder |
debug() your data array |
# |
Jan 30th 2014, 20:00 |
the-neon |
BackEndCoder, if the save() isn't working... how to find why? debugKit isn't giving me much to work with |
# |
Jan 30th 2014, 19:59 |
liamkeily |
rather than going through the array unlocking each index and field. |
# |
Jan 30th 2014, 19:59 |
BackEndCoder |
or you could just do a direct save on the joining table |
# |
Jan 30th 2014, 19:59 |
liamkeily |
is it possible to unlock an array of fields in one line? |
# |
Jan 30th 2014, 19:59 |
todds |
ah, this one speaks spanish. :) |
# |
Jan 30th 2014, 19:59 |
BackEndCoder |
with some pretty arrays of data |
# |
Jan 30th 2014, 19:59 |
BackEndCoder |
i singular save(); etc |
# |
Jan 30th 2014, 19:58 |
BackEndCoder |
then a normal hasMany will be fine |
# |
Jan 30th 2014, 19:58 |
the-neon |
it's an admin panel but I was thinking a form per customer |
# |
Jan 30th 2014, 19:58 |
BackEndCoder |
otherwise it will look just has a normal hasMany save |
# |
Jan 30th 2014, 19:58 |
BackEndCoder |
if its an admin panel, and you are doing it for more than one customer a saveall is required |
# |
Jan 30th 2014, 19:58 |
the-neon |
ACTION [~]# cake quien es tu papi |
# |
Jan 30th 2014, 19:58 |
BackEndCoder |
infact you don't have to use a saveall, if you are doing it for a singular customer |
# |
Jan 30th 2014, 19:58 |
the-neon |
hmmmm |
# |
Jan 30th 2014, 19:57 |
BackEndCoder |
^^ |
# |
Jan 30th 2014, 19:57 |
todds |
you'll still need to generate entries as necessary, but if a customer doesn't receive a custom price, then don't generate an entry. |
# |
Jan 30th 2014, 19:57 |
the-neon |
(a CustomerPrice row I mean ) |
# |
Jan 30th 2014, 19:56 |
the-neon |
that would create a row for each product... so that's where I've been wrong? |
# |
Jan 30th 2014, 19:56 |
BackEndCoder |
you would use a saveAll |
# |
Jan 30th 2014, 19:56 |
the-neon |
I was thinking of a form listing price fields for each active product in the DB |
# |
Jan 30th 2014, 19:56 |
BackEndCoder |
yeah exactly, could it would be linking for no reason |
# |
Jan 30th 2014, 19:56 |
the-neon |
how would I go if I need the customer to be able to mass overwrite the product prices? |
# |
Jan 30th 2014, 19:55 |
todds |
and, more importantly, the row doesn't mean anything. |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
thats a lot of rows |
# |
Jan 30th 2014, 19:55 |
BackEndCoder |
cause everyone customer for every product would needa row |