Refactor Sending::setSubscribers() to use Doctrine instead of Paris
[MAILPOET-4368]
This commit is contained in:
committed by
Aschepikov
parent
b252043dac
commit
8fd8b8f193
@@ -125,6 +125,17 @@ class ScheduledTaskSubscribersRepository extends Repository {
|
||||
->execute();
|
||||
}
|
||||
|
||||
public function setSubscribers(ScheduledTaskEntity $task, array $subscriberIds): void {
|
||||
$this->deleteByScheduledTask($task);
|
||||
|
||||
foreach ($subscriberIds as $subscriberId) {
|
||||
$this->createOrUpdate([
|
||||
'task_id' => $task->getId(),
|
||||
'subscriber_id' => $subscriberId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
private function checkCompleted(ScheduledTaskEntity $task): void {
|
||||
$count = $this->countBy(['task' => $task, 'processed' => ScheduledTaskSubscriberEntity::STATUS_UNPROCESSED]);
|
||||
if ($count === 0) {
|
||||
|
Reference in New Issue
Block a user