add cascade
This commit is contained in:
parent
7c1c2a7233
commit
a5eaec3544
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\MailRepository;
|
||||
use App\Doctrine\Timestampable;
|
||||
use App\Repository\MailRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
@ -25,8 +25,8 @@ class Mail
|
|||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Mailing::class, inversedBy="mails")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @ORM\ManyToOne(targetEntity=Mailing::class, inversedBy="mails", cascade={"all"})
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
private $mailing;
|
||||
|
||||
|
@ -51,7 +51,7 @@ class Mail
|
|||
private $textContent;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=MailAttachment::class, mappedBy="mail", orphanRemoval=true)
|
||||
* @ORM\OneToMany(targetEntity=MailAttachment::class, mappedBy="mail", orphanRemoval=true, cascade={"all"})
|
||||
*/
|
||||
private $mailAttachments;
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ class MailAttachment
|
|||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Mail::class, inversedBy="mailAttachments")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @ORM\ManyToOne(targetEntity=Mail::class, inversedBy="mailAttachments", cascade={"all"})
|
||||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
|
||||
*/
|
||||
private $mail;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class Mailing
|
|||
private $label;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Mail::class, mappedBy="mailing", orphanRemoval=true)
|
||||
* @ORM\OneToMany(targetEntity=Mail::class, mappedBy="mailing", orphanRemoval=true, cascade={"all"})
|
||||
*/
|
||||
private $mails;
|
||||
|
||||
|
|
Loading…
Reference in New Issue