我有一个 Vehicule 实体,我想用easyAdmin Bundle对其进行配置。我的实体有两个主键:immatriculation 和 user(来自实体用户:id_user):
//Vehicule Entity
/**
* @ORM\Id
* @ORM\Column(type="string", name="num_immat")
*/
private $immatriculation;
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="CMN\PortailFretBundle\Entity\User", inversedBy="vehicules")
* @ORM\JoinColumn(name="id_user", referencedColumnName="id_user")
*/
private $user;
我将我的实体添加到 admin.yml 文件中:
entities:
Vehicule:
label: "vehicules"
class: CMN\PortailFretBundle\Entity\Vehicule
form:
fields: ['immatriculation','longueur', 'user']
edit:
fields: ['immatriculation','longueur', 'user']
list:
fields:
- { property: 'immatriculation'}
- { property: 'longueur'}
当我尝试查看车辆管理时,我收到此错误:
Single id is not allowed on composite primary key in entity CMN\PortailFretBundle\Entity\Vehicule
easyAdminBundle 不支持两个主键吗?我该怎么做?