我有三个实体:
User
>
UserVersion
>
Color
是的。每个实体都与
fetch="EAGER"
是的。
用户
班级:
class User
{
/**
* @var UserVersion[]|ArrayCollection
*
* @ORM\OneToMany(
* targetEntity="App\Entity\UserVersion",
* mappedBy="user",
* cascade={"persist"},
* fetch="EAGER",
* )
*/
protected $versions;
用户版本
班级:
class UserVersion
{
/**
* @var Color
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\Color",
* fetch="EAGER",
* )
*/
private $color;
但当我得到用户
$entityManager->getRepository(User::class)->find(2)
我加入了
用户
>
用户版本
但不是
用户版本
>
颜色
是的。
我想加入我的三个实体是有可能还是我必须这么做
$this->createQueryBuilder()
手动连接呢?