diff options
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/ContactFormController.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/controller/ContactFormController.php b/src/controller/ContactFormController.php index 01faa72..243740f 100644 --- a/src/controller/ContactFormController.php +++ b/src/controller/ContactFormController.php | |||
| @@ -7,6 +7,15 @@ use Doctrine\ORM\EntityManager; | |||
| 7 | 7 | ||
| 8 | class ContactFormController | 8 | class ContactFormController |
| 9 | { | 9 | { |
| 10 | static public function keepEmails(EntityManager $entityManager, array $json): void | ||
| 11 | { | ||
| 12 | $form_data = $entityManager->find('App\Entity\NodeData', $json['id']); | ||
| 13 | $form_data->updateData('keep_emails', $json['checked'] ? true : false); | ||
| 14 | $entityManager->persist($form_data); | ||
| 15 | $entityManager->flush(); | ||
| 16 | echo json_encode(['success' => true, 'checked' => $json['checked']]); | ||
| 17 | die; | ||
| 18 | } | ||
| 10 | static public function setEmailParam(EntityManager $entityManager, array $json): void | 19 | static public function setEmailParam(EntityManager $entityManager, array $json): void |
| 11 | { | 20 | { |
| 12 | $form = new FormValidation($json, 'email_params'); | 21 | $form = new FormValidation($json, 'email_params'); |
