0
我有一個Vehicule實體,我想配置它與easyAdmin軟件包。 我的實體有兩個主鍵:immatriculation和用戶(從實體用戶:id_user):EasyAdminBundle:錯誤添加實體與複合主鍵
//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是否不支持兩個主鍵?我該怎麼做?