Fix reset subscriptions in SegmentsRepository

When we update subscriber segment status via executeUpdate,
we have to refresh state from the DB.

[MAILPOET-3551]
This commit is contained in:
Jan Lysý
2021-04-06 11:41:44 +02:00
committed by Veljko V
parent 0ff3f9bf04
commit aaf85e0415

View File

@ -60,6 +60,10 @@ class SubscriberSegmentRepository extends Repository {
'status' => SubscriberEntity::STATUS_UNSUBSCRIBED,
'typeWordPress' => SegmentEntity::TYPE_WP_USERS,
]);
// Refresh SubscriberSegments status
foreach ($subscriber->getSubscriberSegments() as $subscriberSegment) {
$this->entityManager->refresh($subscriberSegment);
}
}
}