From looking at #1969698: ConfigEntity::save() should disallow saving ID/UUID conflicts (Field UUID changes can badly corrupt field data), we are injecting the entity query factory class into our controllers, so we can use entity queries to do things. However, at the moment there is no interface, so you have to type the actual factory class name. This makes it harder to switch out entity query factories, and harder to test. If someone wanted to swap out the confing QueryFactory class for instance, they would have a hard time if we type the parameters.
It makes sense to create QueryFactoryInterface that they all implement. Then it solves our problem. We can also clean up the QueryFactory classes while we're there, as config a field_storage_sql Queryfactory classes are passing the entity manager as a param to get/getAggregate, when we could just get the container to pass this into the constructor for us, as we are in the entity QueryFactory class.
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
d8.QueryFactoryInterface.patch | 10.17 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 58,205 pass(es). | View details | Re-test |