What is this feature about (expected vs actual behaviour)?
How my code looks:
/**
* @ORM\OneToOne(targetEntity="App\Entity\entityY", mappedBy="entityX", fetch="EAGER")
* @ORM\JoinColumn(name="entityYId", referencedColumnName="id")
* @var entityY
*/
private $entityY;
Expected behaviour would be to load data in $Y before I try to access it but the actual thing that is happening is that I am getting a null value in that field.
If I am not using fetch="EAGER" it defaults to fetch="LAZY" which works fine and i do end up having an entity App\Entity\Y in $Y.
How can I reproduce it?
Just make two entities that have OneToOne relationship and in one table put a code similar to this:
/**
* @ORM\OneToOne(targetEntity="App\Entity\Y", mappedBy="X", fetch="EAGER")
* @ORM\JoinColumn(name="XId", referencedColumnName="Yid")
* @var Y
*/
private $Y;
Does it take minutes, hours or days to fix?
I am not sure how long it would take to fix.
What is this feature about (expected vs actual behaviour)?
How my code looks:
Expected behaviour would be to load data in
$Ybefore I try to access it but the actual thing that is happening is that I am getting anullvalue in that field.If I am not using
fetch="EAGER"it defaults tofetch="LAZY"which works fine and i do end up having an entityApp\Entity\Yin$Y.How can I reproduce it?
Just make two entities that have OneToOne relationship and in one table put a code similar to this:
Does it take minutes, hours or days to fix?
I am not sure how long it would take to fix.