Elcodi\Admin\ProductBundle\Controller\PackController::editAction PHP Метод

editAction() публичный Метод

Edit and Saves pack
public editAction ( Symfony\Component\Form\FormInterface $form, Elcodi\Component\Product\Entity\Interfaces\PackInterface $pack, boolean $isValid ) : RedirectResponse
$form Symfony\Component\Form\FormInterface Form
$pack Elcodi\Component\Product\Entity\Interfaces\PackInterface Pack
$isValid boolean Is valid
Результат Symfony\Component\HttpFoundation\RedirectResponse Redirect response
    public function editAction(FormInterface $form, PackInterface $pack, $isValid)
    {
        if ($isValid) {
            $firstImage = $pack->getSortedImages()->first();
            if ($firstImage instanceof ImageInterface) {
                $pack->setPrincipalImage($firstImage);
            }
            $this->flush($pack);
            $this->addFlash('success', $this->get('translator')->trans('admin.purchasable_pack.saved'));
            return $this->redirectToRoute('admin_purchasable_pack_list');
        }
        return ['pack' => $pack, 'form' => $form->createView()];
    }