Eccube\Controller\ShoppingController::shippingChange PHP Метод

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

お届け先変更がクリックされた場合の処理
public shippingChange ( Application $app, Request $request, $id )
$app Eccube\Application
$request Symfony\Component\HttpFoundation\Request
    public function shippingChange(Application $app, Request $request, $id)
    {
        $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']);
        if (!$Order) {
            $app->addError('front.shopping.order.error');
            return $app->redirect($app->url('shopping_error'));
        }
        if ('POST' !== $request->getMethod()) {
            return $app->redirect($app->url('shopping'));
        }
        $builder = $app['eccube.service.shopping']->getShippingFormBuilder($Order);
        $event = new EventArgs(array('builder' => $builder, 'Order' => $Order), $request);
        $app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_SHOPPING_SHIPPING_CHANGE_INITIALIZE, $event);
        $form = $builder->getForm();
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $data = $form->getData();
            $message = $data['message'];
            $Order->setMessage($message);
            // 受注情報を更新
            $app['orm.em']->flush();
            // お届け先設定一覧へリダイレクト
            return $app->redirect($app->url('shopping_shipping', array('id' => $id)));
        }
        return $app->render('Shopping/index.twig', array('form' => $form->createView(), 'Order' => $Order));
    }