Пример #1
0
 /**
  * Note if this submission is from a focus submit.
  *
  * @param SubmissionEvent $event
  */
 public function onFormSubmit(SubmissionEvent $event)
 {
     // Check the request for a focus field
     $id = $this->request->request->get('mauticform[focusId]', false, true);
     if (!empty($id)) {
         $focus = $this->model->getEntity($id);
         if ($focus && $focus->isPublished()) {
             // Make sure the form is still applicable
             $form = $event->getSubmission()->getForm();
             if ((int) $form->getId() === (int) $focus->getForm()) {
                 $this->model->addStat($focus, Stat::TYPE_FORM, $event->getSubmission());
             }
         }
     }
 }