I noticed that properties of entites are being removed (!) from the entity itself (before saving) when they contain validation errors. Instead they are moved to the protected “[invalid]” property.
Is this a bug, or intended behavior?
This doesn’t make any sense to me. Shouldn’t the entity model remain consistent even if the property does not pass validation?
The documentation states _invalid: “List of invalid fields and their data for errors upon validation/patching”. This isn’t true at least for “requirePresence” and ->setError(). In this case the invalid fields aren’t listed.
Am I misunderstanding something?
I’m using cakephp 3.4.