sSaveComment example

$context = [
                    'sConfirmLink' => $link,
                    'sArticle' => ['articleName' => $product],
                ];

                $mail = $this->container->get('templatemail')->createMail('sOPTINVOTE', $context);
                $mail->addTo($this->Request()->getParam('sVoteMail'));
                $mail->send();
            } else {
                $this->container->get(Config::class)->offsetUnset('sOPTINVOTE');
                $this->container->get('modules')->Articles()->sSaveComment($id);
            }
        } else {
            $view->assign('sFormData', $this->container->get('front')->ensureRequest()->getPost());
            $view->assign('sErrorFlag', $sErrorFlag);
        }

        $view->assign('sAction', 'ratingAction');

        $this->forward(
            $this->Request()->getParam('sTargetAction', 'index'),
            $this->Request()->getParam('sTarget', 'detail')
        );
// Customer confirmed the link in the mail                 $commentConfirmQuery = $this->getCommentConfirmRepository()->getConfirmationByHashQuery($hash);
                $getComment = $commentConfirmQuery->getOneOrNullResult();

                if ($getComment) {
                    $commentData = unserialize($getComment->getData()['allowed_classes' => false]);

                    // Delete the data in the s_core_optin table. We don't need it anymore                     $this->get('models')->remove($getComment);
                    $this->get('models')->flush();

                    $this->sSaveComment($commentData$blogArticleId);

                    $this->forward('detail');

                    return;
                }
                $sErrorFlag['invalidHash'] = true;
            }

            // Validation only occurs when entering data, but not on failed Double-Opt-In             if (!($sErrorFlag['invalidHash'] ?? false)) {
                if (empty($this->Request()->name)) {
                    
Home | Imprint | This part of the site doesn't use cookies.