I have Campaigns and Actions. Each Campaign can has unlimited actions (even can be repeated).
Cakephp documentation say you can save the asociation with actions._ids but I have a problem with this. Each campaign_action has a duration. Then if I use actions._ids I can save the relationship without problems but I can't save duration in each campaign_duration.
Now I am saving with this data:
actions => [
0 => [
id => 3,
_joinData => [
duration => 40,
],
],
1 => [
id => 5,
_joinData => [
duration => 25,
],
],
]
The problem is that if I have same "action" but with different "duration" it saves me only 1 "campaign_action" (the lastest).
actions => [
0 => [
id => 3,
_joinData => [
duration => 40,
],
],
1 => [
id => 5,
_joinData => [
duration => 25,
],
],
2 => [
id => 3,
_joinData => [
duration => 15,
],
],
]
How can I do this?