# |
Jun 27th 2017, 07:20 |
sebollson |
yes |
# |
Jun 27th 2017, 07:20 |
sebollson |
thus i have naturally ommited the array |
# |
Jun 27th 2017, 07:20 |
savant |
its not hasOne |
# |
Jun 27th 2017, 07:20 |
savant |
its still hasMany |
# |
Jun 27th 2017, 07:20 |
sebollson |
now i tried to save only 1 entity |
# |
Jun 27th 2017, 07:20 |
sebollson |
it is obvious, as there are many comments saved |
# |
Jun 27th 2017, 07:20 |
sebollson |
but |
# |
Jun 27th 2017, 07:20 |
savant |
;) |
# |
Jun 27th 2017, 07:20 |
savant |
which is an array of arrays |
# |
Jun 27th 2017, 07:20 |
savant |
and it has a `comments` array |
# |
Jun 27th 2017, 07:19 |
sebollson |
and now i see what is going on |
# |
Jun 27th 2017, 07:19 |
savant |
since thats what you have |
# |
Jun 27th 2017, 07:19 |
sebollson |
yes i know |
# |
Jun 27th 2017, 07:19 |
savant |
and searched for “hasmany” |
# |
Jun 27th 2017, 07:19 |
sebollson |
https://book.cakephp.org/3.0/en/orm/saving-data.html#converting-hasmany-data |
# |
Jun 27th 2017, 07:19 |
savant |
i went to the “saving data” docs page |
# |
Jun 27th 2017, 07:19 |
savant |
https://book.cakephp.org/3.0/en/orm/saving-data.html#converting-hasmany-data |
# |
Jun 27th 2017, 07:19 |
savant |
i’ll bet you an ice cream |
# |
Jun 27th 2017, 07:18 |
savant |
i guarantee you its documented |
# |
Jun 27th 2017, 07:18 |
sebollson |
i did |
# |
Jun 27th 2017, 07:18 |
savant |
you didnt read the docs |
# |
Jun 27th 2017, 07:18 |
sebollson |
this should be better documented |
# |
Jun 27th 2017, 07:18 |
savant |
no problem |
# |
Jun 27th 2017, 07:18 |
sebollson |
thank you very much |
# |
Jun 27th 2017, 07:18 |
sebollson |
yes you are right |
# |
Jun 27th 2017, 07:18 |
sebollson |
es |
# |
Jun 27th 2017, 07:18 |
sebollson |
. |
# |
Jun 27th 2017, 07:17 |
savant |
‘user_roles’ => [[‘active’ => 1, ‘display’ => ‘root’]] |
# |
Jun 27th 2017, 07:17 |
savant |
since it is hasMany, you need to have an array of user_role arrays |
# |
Jun 27th 2017, 07:17 |
sebollson |
relation is just ommited ;/ |
# |
Jun 27th 2017, 07:16 |
sebollson |
userRoles |
# |
Jun 27th 2017, 07:16 |
sebollson |
userroles |
# |
Jun 27th 2017, 07:16 |
sebollson |
like user_roles |
# |
Jun 27th 2017, 07:16 |
sebollson |
i tired different keys |
# |
Jun 27th 2017, 07:16 |
sebollson |
This does not saves UserRoles |
# |
Jun 27th 2017, 07:16 |
rudy1976s |
Hi @savant sorry I did search badly, thank you |
# |
Jun 27th 2017, 07:16 |
sebollson |
], ['validate' => false]); |
# |
Jun 27th 2017, 07:16 |
sebollson |
] |
# |
Jun 27th 2017, 07:16 |
sebollson |
"name" => "admin" |
# |
Jun 27th 2017, 07:16 |
sebollson |
"UserRoles" => [ |
# |
Jun 27th 2017, 07:16 |
sebollson |
"active" => 1, |