This is a (multiple allowed):
While dev/testing i've baked three models
- documents
- document_types
- document_types_documents
Having done some changes, i've manually added belongsToMany from Documents to DocumentTypes
Setting data correctly through Form->control('document_types._ids', ['options'=>$arr])
What was not working is saving data, and there is no warning/error about it.
DocumentsTable $_accessible was missing property 'document_types'=>true which corresponds with belongsToMany alias, adding it fixed everything.
So I'd like to know, if it is possible to make such situation developer-detectable, that Documents->patchEntity($document, $this->request->getData()) does not set the BTM fields (or generate appropriate entitites), because of the BTM alias/field accessibility
It is currently not even detectable from contents of $document (in this case) entity after patching, because neither dirty, original or other fields, that could hint such problem, do not reflect this.
Thank you