@param ViewPostRequest $request

@return Post
@throws PostDoesNotExistException
336882
public function execute(ViewPostRequest $request)
    {
        $post = $this->repository->findById(new PostId($request->getId()));

        if (null === $post) {
            throw new PostDoesNotExistException();
        }

        return $post;
    }
1284036
public function handleHttpRequest($request)
    {
        $this->parseRequestBase($request);

        if (isset($request->header['x-rpc']) && $request->header['x-rpc'] == 1) {
            $this->routeParams->isRpc          = true;
            $this->routeParams->params         = $request->post ?? $request->get ?? [];
            $this->routeParams->controllerName = 'Rpc';
            $this->routeParams->methodName     = 'Index';
            $this->controllerClassName         = '\PG\MSF\Controllers\Rpc';
            $this->routeParams->path           = '/Rpc/Index';
        } else {
            if ($this->routeParams->path) {
                $this->parsePath($this->routeParams->path);
            }
        }
    }
1052159
protected function findMatchingWordPressPost(Request $request)
    {
        if (!is_admin() && !is_404()) {

            $route = null;

            if (app()->isShared('post')) {
                $route = $this->getByName('__catch_' . str_replace('\\', '.', get_class(app('post'))));
            } elseif (app()->isShared('wp_query') && app('wp_query')->is_posts_page) {
                $route = $this->getByName('__catch_' . str_replace('\\', '.', app('posts.types')->get('post')));
            }

            if (!is_null($route)) {
                return $route->bind($request);
            }

        }

        return null;
    }
1322304
public function bindRequest(Request $request)
    {
        $this->request = $request;

        foreach ($this->request->postArray() as $key => $value) {
            if (isset($this->fieldSet[$key])) {
                $this->fieldSet[$key]->setValue($value);
            }
        }
    }
658429
public function postGenerateAction(Request $request)
    {
        $parentUuid = $this->getRequestParameter($request, 'parent');
        $parts = $this->getRequestParameter($request, 'parts', true);
        $templateKey = $this->getRequestParameter($request, 'template', true);
        $webspaceKey = $this->getRequestParameter($request, 'webspace', true);
        $languageCode = $this->getLocale($request);

        $result = $this->getResourceLocatorRepository()->generate(
            $parts,
            $parentUuid,
            $webspaceKey,
            $languageCode,
            $templateKey
        );

        return $this->handleView($this->view($result));
    }
1328311
public function createAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $entity  = new WPSetup();

        $form = $this->createForm(new WPSetupType($this->container), $entity);
        $form->bind($request);

        if ($form->isValid()) {

            $user = $this->get('security.context')->getToken()->getUser();

            $domain = $form['domain']->getData();
            if(isset($form['user']))
                $domain->setUser($form['user']->getData());

            $em->persist($domain);

            $httpdhost = new HttpdHost();
            $httpdhost->setDomain($domain);

            // Add open_basedir wordpress directory
            $configuration = "
                <Directory '/home/$user/web/$domain/httpdocs'>
                    php_admin_value open_basedir '/home/$user/web/$domain:/srv/httpd/error:/tmp:/var/www/source'
                </Directory>";
            $httpdhost->setConfiguration($configuration);
            $em->persist($httpdhost);

            $validator = $this->get('validator');
            // Add database and user
            $wpdb = new DB();
            $wpdb->setName($user->getUsername().'_wp_'.$httpdhost->getId());
            $em->persist($wpdb);

            $dbuser = new DatabaseUser();
            $dbuser->setUsername($user->getId().'_wp_'.$httpdhost->getId());
            $dbuser->setDb($wpdb);
            $dbuser->setPassword('');
            $em->persist($dbuser);

            $entity->setHttpdHost($httpdhost);
            $entity->setDatabaseUser($dbuser);
            $entity->setEnabled(true);
            $em->persist($entity);

            $em->flush();

            return $this->redirect($this->generateUrl('wpsetup_show', array('id' => $entity->getId())));
        }

        return $this->render('ACSACSPanelWordpressBundle:WPSetup:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),
        ));
    }
112118
public function applyPostHandle(ServletRequestInterface $request, ServletResponseInterface $response, ModelAndView $model)
    {
        $interceptors = $this->getInterceptors();
        if (!empty($interceptors)) {
            for ($i = $this->interceptorIndex; $i >= 0; $i--) {
                $interceptor = $interceptors[$i];
                $interceptor->postHandle($request, $response, $this->handler, $model);
            }
        }
    }
944973
public function postAction(Request $request)
    {
        try {
            $data = $request->request->all();
            $this->validatePostData($data);
            $locale = $this->getLocale($request);

            // Calculate prices for given item
            $price = $this->getPriceCalculationManager()->retrieveItemPrices(
                $data['items'],
                $data['currency'],
                $locale
            );

            $view = $this->view($price, 200);
        } catch (PriceCalculationException $pce) {
            $view = $this->view($pce->getMessage(), 400);
        }

        return $this->handleView($view);
    }
116357
public function addToCampaignForm($request)
    {
        // Get ID either from posted back value, or url parameter
        $id = $request->param('ID') ?: $request->postVar('ID');
        return $this->getAddToCampaignForm($id);
    }
955388
public function settingsPostAction(Request $request, View $view)
    {
        $em = $this->getDoctrine()->getManager();

        $pageSeo = $view->getSeo() ?: new PageSeo();
        $form = $this->createSettingsForm($pageSeo, $view);

        $form->handleRequest($request);
        $novalidate = $request->query->get('novalidate', false);

        if (false === $novalidate && $form->isValid()) {
            $em->persist($pageSeo);
            $view->setSeo($pageSeo);
            $em->persist($view);
            $em->flush();

            $this->get('victoire_core.current_view')->setCurrentView($view);
            $this->congrat('victoire_seo.save.success');

            $response = [
                'success' => true,
                'url'     => $this->getViewUrl($view),
            ];
        } else {
            $response = $this->getNotPersistedSettingsResponse($form, $view, $novalidate);
        }

        return new JsonResponse($response);
    }
154005
public function postAction(Request $request)
    {
        $params = array();
        $content = $request->getContent();
        if (!empty($content))
        {
            $params = json_decode($content, true); // 2nd param to get as array
        }
        $uuid = $params['authData']['anonymous']['id'];
        $pw   = $params['authData']['anonymous']['pw'];
        /* @var $user UserInterface */
        $user = $this->registerAnonymous($uuid, $pw);

        return new JsonResponse([
            'createDate'=> $user->getCreatedAt()
            , 'objectId'=> $user->getId()
            , 'userName'=> $user->getUsername()
            , 'authData'=> $params['authData']
            , 'updateDate'=> $user->getUpdatedAt()
        ]);
    }
848344
public function createView(Request $request)
    {
        $viewInput = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        if ($viewInput->query instanceof LocationQuery) {
            $method = 'findLocations';
        } else {
            $method = 'findContent';
        }

        return new Values\RestExecutedView(
            array(
                'identifier' => $viewInput->identifier,
                'searchResults' => $this->searchService->$method(
                    $viewInput->query,
                    ['languages' => Language::ALL]
                ),
            )
        );
    }
1293325
public function postAction(Request $request)
    {
        try {
            $this->checkArguments($request);
            $contact = $this->getContactManager()->save(
                $request->request->all()
            );
            $apiContact = $this->getContactManager()->getContact(
                $contact,
                $this->getLocale($request)
            );
            $view = $this->view($apiContact, 200);
            $context = new Context();
            $context->setGroups(static::$contactSerializationGroups);
            $view->setContext($context);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (MissingArgumentException $maex) {
            $view = $this->view($maex->toArray(), 400);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        return $this->handleView($view);
    }
933915
public function postAction(Request $request)
    {
        $document = $this->documentManager->create(Structure::TYPE_SNIPPET);
        $form = $this->processForm($request, $document);

        return $this->handleView($form->getData());
    }
1188769
public function insertCustom(Request $request)
    {
        $validation = Validator::make($request->all(), [
            'name'  => 'required|unique:menus,name',
            'title' => 'required'
        ]);
        if ($validation->fails()) {
            return redirect()->back()->withInput()->withErrors($validation);
        }
        // Create controller
        $controllerBuilder = new ControllerBuilder();
        $controllerBuilder->buildCustom($request->name);

        // Create views
        $viewsBuilder = new ViewsBuilder();
        $viewsBuilder->buildCustom($request->name);

        $menu = Menu::create([
            'position'  => 0,
            'menu_type' => 3,
            'icon'      => $request->icon != '' ? $request->icon : 'fa-database',
            'name'      => $request->name,
            'title'     => $request->title,
            'parent_id' => $request->parent_id ?: null,
        ]);
        $menu->roles()->sync($request->input('roles', []));

        return redirect()->route('menu');
    }
293562
protected function crudCreate(Request $request = null)
    {
        try{
            
            $entity = $this->getEntity();
            $form = $this->createAndBindForm($request, $this->getEntityType() , $entity);
            $page = static::NEW_VIEW;
            
            if ($form->isValid()) {
                $this->saveEntity($entity);                
                if($request->get('_loop_create')){
                    $form = $this->createForm($this->getEntityType(), $this->getEntity());
                }else{
                    $page = static::SHOW_VIEW;
                    $form = $this->createDeleteForm($entity->getId());
                }
                $form = $form->createView();
                return $this->render($page, $this->commonsResponseVars(compact('entity','form')));
            }
            $form = $form->createView();
            return $this->success($page, $this->commonsResponseVars(compact('entity','form')));
            
        }catch(\Exception $e){
          return $this->failure($e);
        }
    }
410280
public function store(NoteRequest $request)
    {
        $note = auth()->user()->notes()->create($request->all());

        return $this->makeRedirect(true, 'admin.notes.index', __('msg.store'));
    }