Elcodi\Admin\NewsletterBundle\Controller\NewsletterSubscriptionController::saveAction PHP Method

saveAction() public method

Should be POST
public saveAction ( Elcodi\Component\Newsletter\Entity\Interfaces\NewsletterSubscriptionInterface $entity, Symfony\Component\Form\FormInterface $form, boolean $isValid ) : RedirectResponse
$entity Elcodi\Component\Newsletter\Entity\Interfaces\NewsletterSubscriptionInterface Entity to save
$form Symfony\Component\Form\FormInterface Form view
$isValid boolean Request handle is valid
return Symfony\Component\HttpFoundation\RedirectResponse Redirect response
    public function saveAction(NewsletterSubscriptionInterface $entity, FormInterface $form, $isValid)
    {
        if ($isValid) {
            $this->get('elcodi.object_manager.newsletter_subscription')->flush($entity);
        }
        return $this->redirectRoute("admin_newsletter_subscription_view", ['id' => $entity->getId()]);
    }