In Doctrine, you can set the sampling mode in your entities to retrieve all the data on one request and not lazily load all of them.
/** * @ORM\OneToOne(targetEntity="Application\Entity\Categorie" , fetch="EAGER") * @ORM\JoinColumn(name="CAT_ID", referencedColumnName="CAT_ID") * @access protected * @var \Application\Entity\Categorie */ protected $CAT_ID;
I have problems with this when it comes to level 3. Entity "a" refers to object "b". Object "b" refers to object "c". Object "a" and object "b" are selected in one request, and entity "c" is separated from them in one request. I set fetch="EAGER" for each relationship between them.
Do not Doctrine handles fetch="EAGER" at level 3, or what happens wrong?
zend-framework2 doctrine2
Stillmatic1985
source share