# |
Jun 27th 2017, 07:21 |
sebollson |
will do that |
# |
Jun 27th 2017, 07:21 |
sebollson |
ok |
# |
Jun 27th 2017, 07:21 |
sebollson |
sayiong that you have to always have an array |
# |
Jun 27th 2017, 07:21 |
savant |
you can submit a change to the docs |
# |
Jun 27th 2017, 07:21 |
savant |
there is a helpful “pen” button on the sidebar |
# |
Jun 27th 2017, 07:20 |
savant |
well if you dont think its well documented |
# |
Jun 27th 2017, 07:20 |
sebollson |
maybe some warning would be helpfull |
# |
Jun 27th 2017, 07:20 |
savant |
“naturally” |
# |
Jun 27th 2017, 07:20 |
sebollson |
but |
# |
Jun 27th 2017, 07:20 |
sebollson |
true |
# |
Jun 27th 2017, 07:20 |
sebollson |
ok |
# |
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 ;/ |