Doctrine2 one-to-one relation auto loads on query

前端 未结 6 1707
借酒劲吻你
借酒劲吻你 2020-12-23 12:53

I have a query that looks like this:

My user entity has a one-to-one relation that looks like this:

/**
 * @var UserProfile
 *
 * @ORM\\OneToOne(targ         


        
6条回答
  •  我在风中等你
    2020-12-23 13:34

    According to the reference you can add the optional attribute fetch

    /**
     * @var UserProfile
     *
     * @ORM\OneToOne(targetEntity="UserProfile",mappedBy="user", fetch="LAZY")
     */
    private $userProfile;
    

提交回复
热议问题