From d59a63d31287a562ed9dc9e82627beb451a326d0 Mon Sep 17 00:00:00 2001 From: Yann-BUTSCHER-EIRL Date: Wed, 20 Mar 2024 18:09:16 +0100 Subject: [PATCH] #328 Prevent PeopleType suppression when deleting a People and the other way around --- src/Entity/People.php | 2 +- src/Entity/PeopleType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/People.php b/src/Entity/People.php index d6b02dee..b2b88357 100644 --- a/src/Entity/People.php +++ b/src/Entity/People.php @@ -183,7 +183,7 @@ class People private $addresses; /** - * @ORM\ManyToMany(targetEntity="App\Entity\PeopleType", inversedBy="peoples", cascade={"persist", "remove"}) + * @ORM\ManyToMany(targetEntity="App\Entity\PeopleType", inversedBy="peoples", cascade={"persist"}) * @ORM\JoinTable( * name="peoples_people_types", * joinColumns={@JoinColumn(name="people_id", referencedColumnName="id")}, diff --git a/src/Entity/PeopleType.php b/src/Entity/PeopleType.php index b2ed1fb2..7dfa76c7 100644 --- a/src/Entity/PeopleType.php +++ b/src/Entity/PeopleType.php @@ -50,7 +50,7 @@ class PeopleType private $isSensible; /** - * @ORM\ManyToMany(targetEntity="App\Entity\People", mappedBy="types", cascade={"persist", "remove"}) + * @ORM\ManyToMany(targetEntity="App\Entity\People", mappedBy="types", cascade={"persist"}) * */ private $peoples;