如何在第三个表中创建两个表的记录,以获取两个表之一的第三个标识符中的表。使用ORM Doctrine2 Database image
现在的事情是:
// Account.php
/**
* @ORM\ManyToOne(targetEntity="UserCoworking", inversedBy="accountCoworking")
* @ORM\JoinColumn(name="acoount_id", referencedColumnName="id")
*/
private $userCoworking;
/**
* @ORM\ManyToOne(targetEntity="UserClient", inversedBy="accountUserClient")
* @ORM\JoinColumn(name="acoount_id", referencedColumnName="id")
*/
private $userClient;
// User coworking
/**
* @ORM\OneToMany(targetEntity="Account", mappedBy="userCoworking")
*/
private $accountCoworking;
// User client
/**
* @ORM\OneToMany(targetEntity="Account", mappedBy="userClient")
*/
private $accountUserClient;