こんにちは、スタックオーバーフローのメンバー!私はこの問題を抱えていた多くの関係船 に多くでエンティティを更新しようとすると、 私は、教義2は、すべては私が私のエンティティおよびコマンドでプロキシを生成している、完全に を作業インストールDoctrine 2とManyToMany関係でオブジェクトを更新する方法
私の問題がされてい
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-1' for key 'PRIMARY''
doctrineが新しいエンティティを挿入しようとしましたが、私のコードに問題がある場合は、結合テーブル を更新しようとしていません。 おかげで
//update entities user
$user=$this->em->getRepository('Entities\User')->find((int)$this->input->post('id'));
$user->setNom($this->input->post('nom'));
$user->setPrenom($this->input->post('prenom'));
//update entities services(user have many service)
foreach($this->input->post('services') as $post){
$service = $this->em->getRepository('Entities\Service')->find((int)$post);
if ($service instanceof Entities\Service) {
$user->addService($service);
}
$this->em->flush();
をチェックアウトし、「日」から取得された、彼らはされているあなたのテーブル – DavidLin