Mautic插件删除表格提交

时间:2018-07-10 15:19:51

标签: php symfony doctrine mautic

我目前正在为Mautic制作插件,并且被困在如何将表单提交到数据库中后将其删除。是否可以使用提交ID或提交实体从表单中删除特定表单提交?

这是我尝试过的方法,但是没有用。

// Attempt 1
public function onFormSubmitAction(SubmissionEvent $event)
{
    $submissionModel = $factory->getModel('form.submission');
    $submission = $event->getSubmission();
    $submissionModel->deleteEntity($submission);
}

// Attempt 2
public function onFormSubmitAction(SubmissionEvent $event)
{
    $form = $event->getForm();
    $submission = $event->getSubmission();
    $form->removeSubmission($submission);
}

0 个答案:

没有答案