Change NewsletterCoupon::cleanupSensitiveData signature

This change allows passing body array and retuning body array
so that NewsletterEntity instance doesn't need to get passed
around

[MAILPOET-4678]
This commit is contained in:
Sam Najian
2023-01-23 12:09:43 +01:00
committed by Aschepikov
parent 59d91ff7ef
commit 9a2d4e83b2
3 changed files with 16 additions and 19 deletions

View File

@@ -187,7 +187,10 @@ class NewsletterSaveController {
// reset sent at date
$duplicate->setSentAt(null);
$duplicate = $this->newsletterCoupon->cleanupSensitiveData($duplicate);
$body = $duplicate->getBody();
if ($body) {
$duplicate->setBody($this->newsletterCoupon->cleanupBodySensitiveData($body));
}
$this->newslettersRepository->persist($duplicate);
$this->newslettersRepository->flush();