Elcodi\Plugin\CustomShippingBundle\Controller\CarrierController::editAction PHP Method

editAction() public method

Edit and Saves category
public editAction ( Symfony\Component\Form\FormInterface $form, Elcodi\Plugin\CustomShippingBundle\Entity\Interfaces\CarrierInterface $carrier, boolean $isValid ) : RedirectResponse
$form Symfony\Component\Form\FormInterface Form
$carrier Elcodi\Plugin\CustomShippingBundle\Entity\Interfaces\CarrierInterface Carrier
$isValid boolean Is valid
return Symfony\Component\HttpFoundation\RedirectResponse Redirect response
    public function editAction(FormInterface $form, CarrierInterface $carrier, $isValid)
    {
        if ($isValid) {
            $this->flush($carrier);
            $this->addFlash('success', $this->get('translator')->trans('admin.carrier.saved'));
            return $this->redirectToRoute('admin_carrier_list');
        }
        return ['carrier' => $carrier, 'form' => $form->createView()];
    }