I am trying to save data directly into the HABTM table offerings_students
I am doing this because there is a field in this table that I need to manually set in my controller.
My $this->data array is currently looking like this, after setting the 'owing' field.
Array
(
[OfferingsStudent] => Array
(
[OfferingsStudent] => Array
(
[0] => Array
(
[offering_id] => 35
[owing] => 209.00
[student_id] => 31
)
)
)
)
The form allows for multiple selection, therefore I must be able to save more than one record into the HABTM table.
My save statement: $this->Student->OfferingsStudent->save($this->data)
The problem is that the records are not being added to the table. I must be able to add multiple records into the table with a single form submission.
I must add that the record is being created, but all the fields end up having zeros.
EDIT:
Changed the array to try submitted solution but still no luck.
$this->data array:
Array
(
[OfferingStudent] => Array
(
[0] => Array
(
[offering_id] => 35
[owing] => 209.00
[student_id] => 31
)
)
)