Hi Im just wondering if it is possible to save multiple data that has hasMany: and if it is possible what is the array structure before executing $this->Model->saveAll($this->data).
example is that you are going to save multiple posts at a time like this:
array(
[Post] => Array
(
[0] => Array
(
[title] => title One
[content] => desc One
)
[1] => Array
(
[title] => title two
[content] => desc two
)
)
So in the given array above we can save all the Post with saveAll but what if each Post have hasMany comment each. how the array should look like if i have to insert the array below:
array(
[Comment] => Array
(
[0] => Array
(
[comment] => 1st Comment for Post One
)
[1] => Array
(
[comment] => 2nd Comment for Post One
)
[2] => Array
(
[comment] => 1st Comment for Post Two
)
[3] => Array
(
[comment] => 2nd Comment for Post Two
)
)
How can I combine the two array to execute saveAll(); Thanks in advance. ^_^