From 9b8fa578c98c39682d5f46b51f680f1323a0642c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 23 Nov 2016 20:10:46 +0100 Subject: [PATCH] Doctrine: entities (fix issues) --- src/AppBundle/Entity/Book.php | 16 ---------------- src/AppBundle/Entity/Category.php | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/AppBundle/Entity/Book.php b/src/AppBundle/Entity/Book.php index a505c10..e64cfee 100644 --- a/src/AppBundle/Entity/Book.php +++ b/src/AppBundle/Entity/Book.php @@ -51,22 +51,6 @@ class Book * targetEntity="Category", * cascade={"persist"} * ) - * @ORM\JoinTable( - * name="book_has_category", - * joinColumns={ - * @ORM\JoinColumn( - * name="book_id", - * referencedColumnName="id" - * ) - * }, - * inverseJoinColumns={ - * @ORM\JoinColumn( - * name="category_id", - * referencedColumnName="id", - * unique=true - * ) - * } - * ) */ private $categories; diff --git a/src/AppBundle/Entity/Category.php b/src/AppBundle/Entity/Category.php index ab6e723..4c14d60 100644 --- a/src/AppBundle/Entity/Category.php +++ b/src/AppBundle/Entity/Category.php @@ -32,7 +32,7 @@ class Category /** * @var \Doctrine\Common\Collections\Collection * - * @ORM\OneToMany( + * @ORM\ManyToMany( * targetEntity="Book", * mappedBy="categories", * cascade={"persist"}