src/Slashworks/AppBundle/Controller/RemoteAppController.php
public function updateAction(Request $request, $id)
        {

            /** @var RemoteApp $oRemoteApp */
            $oRemoteApp = RemoteAppQuery::create()->findOneById($id);

            if (count($oRemoteApp) === 0) {
                throw $this->createNotFoundException('Unable to find RemoteApp entity.');
            }

            $deleteForm = $this->createDeleteForm($id);
            $editForm   = $this->createEditForm($oRemoteApp);
            $editForm->handleRequest($request);


            if ($editForm->isValid()) {

                $sDomain = $oRemoteApp->getDomain();
                if(substr($sDomain,-1,1) !== "/"){
                    $sDomain .= "/";
                    $oRemoteApp->setDomain($sDomain);
                }
                $sModulePath = $oRemoteApp->getApiUrl();
                if(substr($sModulePath,0,1) === "/"){
                    $sModulePath = substr($sModulePath,1);
                    $oRemoteApp->setApiUrl($sModulePath);
                }

                $oRemoteApp->save();

                return $this->redirect($this->generateUrl('remote_app'));
            }

            return $this->render('SlashworksAppBundle:RemoteApp:edit.html.twig', array(
                'entity'      => $oRemoteApp,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
public function updateAction(Request $request, $id)
        {

            /** @var RemoteApp $oRemoteApp */
            $oRemoteApp = RemoteAppQuery::create()->findOneById($id);

            if (count($oRemoteApp) === 0) {
                throw $this->createNotFoundException('Unable to find RemoteApp entity.');
            }

            $deleteForm = $this->createDeleteForm($id);
            $editForm   = $this->createEditForm($oRemoteApp);
            $editForm->handleRequest($request);


            if ($editForm->isValid()) {

                $sDomain = $oRemoteApp->getDomain();
                if(substr($sDomain,-1,1) !== "/"){
                    $sDomain .= "/";
                    $oRemoteApp->setDomain($sDomain);
                }
                $sModulePath = $oRemoteApp->getApiUrl();
                if(substr($sModulePath,0,1) === "/"){
                    $sModulePath = substr($sModulePath,1);
                    $oRemoteApp->setApiUrl($sModulePath);
                }

                $oRemoteApp->save();

                return $this->redirect($this->generateUrl('remote_app'));
            }

            return $this->render('SlashworksAppBundle:RemoteApp:edit.html.twig', array(
                'entity'      => $oRemoteApp,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
public function updateAction ( Request $ request , $ id ) { /** @var RemoteApp $oRemoteApp */ $ oRemoteApp = RemoteAppQuery :: create ( ) -> findOneById ( $ id ) ; if ( count ( $ oRemoteApp ) === 0 ) { throw $ this -> createNotFoundException ( 'Unable to find RemoteApp entity.' ) ; } $ deleteForm = $ this -> createDeleteForm ( $ id ) ; $ editForm = $ this -> createEditForm ( $ oRemoteApp ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isValid ( ) ) { $ sDomain = $ oRemoteApp -> getDomain ( ) ; if ( substr ( $ sDomain , - 1 , 1 ) !== "/" ) { $ sDomain .= "/" ; $ oRemoteApp -> setDomain ( $ sDomain ) ; } $ sModulePath = $ oRemoteApp -> getApiUrl ( ) ; if ( substr ( $ sModulePath , 0 , 1 ) === "/" ) { $ sModulePath = substr ( $ sModulePath , 1 ) ; $ oRemoteApp -> setApiUrl ( $ sModulePath ) ; } $ oRemoteApp -> save ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'remote_app' ) ) ; } return $ this -> render ( 'SlashworksAppBundle:RemoteApp:edit.html.twig' , array ( 'entity' => $ oRemoteApp , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ) ; }
Update existing remote app

@param \Symfony\Component\HttpFoundation\Request $request
@param                                           $id

@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
@throws \Exception
@throws \PropelException
Update existing remote app