Fix scheduled task entity having the same association twice

It also seems that orphanRemoval doesn't play well with our explicit detachAll logic.

[MAILPOET-6047]
This commit is contained in:
Jan Jakes
2024-04-30 16:14:44 +02:00
committed by Rostislav Wolný
parent 55416fd2ff
commit b18bb14ecc
2 changed files with 1 additions and 8 deletions

View File

@@ -95,15 +95,8 @@ class ScheduledTaskEntity {
*/
private $sendingQueue;
/**
* @ORM\OneToMany(targetEntity="MailPoet\Entities\ScheduledTaskSubscriberEntity", mappedBy="task", orphanRemoval=true)
* @var Collection<int, ScheduledTaskSubscriberEntity>
*/
private $scheduledTaskSubscribers;
public function __construct() {
$this->subscribers = new ArrayCollection();
$this->scheduledTaskSubscribers = new ArrayCollection();
}
/**

View File

@@ -45,7 +45,7 @@ class ScheduledTaskSubscriberEntity {
private $error;
/**
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity", inversedBy="scheduledTaskSubscribers")
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity", inversedBy="subscribers")
* @var ScheduledTaskEntity|null
*/
private $task;