I have an entity that has an optional relationship, and it's represented in my domain as a Null Object. When the relationship exists and is non-null, this works fine:
$builder->hasOne(Tote::class);
However, when the relationship isn't set, it fails because NullTote (the default value) can't map to Tote.
This doesn't sound like a problem with this package? We just provide an fluent syntax to doctrine's mapping api. I think you are better off asking this question on a forum/slack.
I have an entity that has an optional relationship, and it's represented in my domain as a Null Object. When the relationship exists and is non-null, this works fine:
$builder->hasOne(Tote::class);
However, when the relationship isn't set, it fails because NullTote (the default value) can't map to Tote.
Is there an easier way of working with null objects in Doctrine's mappings that I'm unaware of? Or is this going to get dirty? I can always try to resolve them (http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/resolve-target-entity-listener.html) but that doesn't really solve my problem.