add delete cascade on profile

master
remrem 10 months ago
parent 8b0ed1c7c6
commit 251f96ce1e

@ -40,7 +40,7 @@ class Post
/**
* @var Collection<int, Commentary>
*/
#[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'post')]
#[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'post', cascade: ['persist', 'remove'])]
private Collection $commentaries;
/**

@ -34,13 +34,13 @@ class Profil implements UserInterface, PasswordAuthenticatedUserInterface
/**
* @var Collection<int, Post>
*/
#[ORM\OneToMany(targetEntity: Post::class, mappedBy: 'profil')]
#[ORM\OneToMany(targetEntity: Post::class, mappedBy: 'profil', cascade: ['remove'])]
private Collection $posts;
/**
* @var Collection<int, Commentary>
*/
#[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'profil')]
#[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'profil', cascade: ['remove'])]
private Collection $commentaries;
/**

Binary file not shown.
Loading…
Cancel
Save