Add an option for schema validation to allow many-to-one relations to be used as one-to-one relations
Author: tg-iservCreated Sep 30, 2026Updated Sep 30, 2026
Feature Request
What
Add an option for schema validation to allow many-to-one relations to be used as one-to-one relations.
Why
One-to-one relations to not support lazy loading (see #12064). We require lazy loading for performance and therefore use a many-to-one relation on the id instead.
With 3.7 this fails the schema validation so we want to suppress those errors.
How
Here are some ideas:
- Add an option to suppress this error class in validation
- Add an option to the ManyToOne attribute to suppress the error for that relation
- Add another attribute which can be added to the id property to suppress the error for the relation associated to the property
- Add lazy loading for one-to-one relations
Source: doctrine/orm