Create a new task.

@param  Request  $request
@return Response
163199
public function store(Request $request)
	{
		$this->authorize('blog',  Auth::user());
	
		$this->validate($request, Evento::storeRules());
		$id = \DB::transaction(function () use ($request){
			$evento = Evento::create(Evento::storeAttributes($request));

			return $evento->id;
		});
		
		return redirect(route('evento.edit', $id));
	}
823912
public function createAction(Request $request)
        {
            $oUser = new User();
            $form = $this->createCreateForm($oUser);
            $form->handleRequest($request);

            if ($form->isValid()) {

                $factory  = $this->get('security.encoder_factory');
                $encoder  = $factory->getEncoder($oUser);
                $password = $encoder->encodePassword($oUser->getPassword(), $oUser->getSalt());
                $oUser->setPassword($password);
                $oUser->save();

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

            return $this->render('SlashworksBackendBundle:User:new.html.twig', array(
                'entity' => $oUser,
                'form'   => $form->createView(),
            ));
        }
202925
public function createURLAlias(Request $request)
    {
        $urlAliasCreate = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        if ($urlAliasCreate['_type'] === 'LOCATION') {
            $locationPathParts = explode(
                '/',
                $this->requestParser->parseHref($urlAliasCreate['location']['_href'], 'locationPath')
            );

            $location = $this->locationService->loadLocation(
                array_pop($locationPathParts)
            );

            try {
                $createdURLAlias = $this->urlAliasService->createUrlAlias(
                    $location,
                    $urlAliasCreate['path'],
                    $urlAliasCreate['languageCode'],
                    $urlAliasCreate['forward'],
                    $urlAliasCreate['alwaysAvailable']
                );
            } catch (InvalidArgumentException $e) {
                throw new ForbiddenException($e->getMessage());
            }
        } else {
            try {
                $createdURLAlias = $this->urlAliasService->createGlobalUrlAlias(
                    $urlAliasCreate['resource'],
                    $urlAliasCreate['path'],
                    $urlAliasCreate['languageCode'],
                    $urlAliasCreate['forward'],
                    $urlAliasCreate['alwaysAvailable']
                );
            } catch (InvalidArgumentException $e) {
                throw new ForbiddenException($e->getMessage());
            }
        }

        return new Values\CreatedURLAlias(
            array(
                'urlAlias' => $createdURLAlias,
            )
        );
    }
346632
public function setRequest(Request $request)
    {
        $this->setParam('request', $request);
        $this->request = $request;
        return $this;
    }
1302840
public function createAction(Request $request)
    {
        $form = $this->container->get('form.factory')->createNamed(
            'page',
            CreationType::class,
            null,
            array(
                'action' => $this->container->get('router')->generate('synapse_admin_page_creation'),
                'method' => 'POST',
                'csrf_protection' => false,
            )
        );

        if ($request->request->has('page')) {
            $form->handleRequest($request);
            if ($form->isValid()) {
                $page = $form->getData()->resolve();

                return $this->redirect(
                    $this->container->get('router')->generate('synapse_admin_page_edition', array(
                        'id' => $page->getId(),
                    ))
                );
            }
        }

        return $this->render('SynapsePageBundle:Admin/Page:create.html.twig', array(
            'form' => $form->createView(),
        ));
    }
315940
private function decorateRequest(Request $request)
    {
        if ($request instanceof Http\Request) {
            return $request;
        }

        return new Http\Request($request);
    }
238964
protected function createTask()
    {
        $task = \call_user_func_array(['parent', 'task'], \func_get_args());
        $task->setInput($this->input());
        $task->setOutput($this->output());

        return $task;
    }
831814
public function create_new($request)
    {
        if (!$this->canCreate()) {
            return $this->httpError(403, "You do not have permission to create new " . $this->getPluralName());
        }
        $this->addCrumb('Create new ' . $this->getSingularName());
        return $this->customise(['Form' => $this->CreationForm()]);
    }
816826
public function createAction(Request $request)
    {
        $templateRepository = $this->get('phlexible_media_template.template_manager');

        $type = $request->get('type');
        $key = $request->get('key');

        switch ($type) {
            case 'image':
                $template = new ImageTemplate();
                $template->setCache(false);
                break;
            case 'video':
                $template = new VideoTemplate();
                $template->setCache(true);
                break;
            case 'audio':
                $template = new AudioTemplate();
                $template->setCache(true);
                break;
            default:
                throw new InvalidArgumentException("Unknown template type $type");
        }

        $template->setKey($key);

        $templateRepository->updateTemplate($template);

        return new ResultResponse(true, 'New "'.$type.'" template "'.$key.'" created.');
    }
881640
public function newAction(Request $request)
    {
        $location = new Location();
        $location->setProfile($this->getCurrentProfile());
        $form = $this->createForm(new LocationType(), $location);

        if ($response = $this->processForm($request, $form, 'Profile_location_show'))
        {
            return $response;
        }

        return $this->render('HarvestCloudCoreBundle:Profile/Location:new.html.twig', array(
          'form' => $form->createView(),
        ));
    }
866743
public function createAction(Request $request)
    {
        $form = $this->getForm();

        if ('POST' == $request->getMethod()) {
            $form->handleRequest($request);
            if ($form->isValid()) {

                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Repository created successfully');

                return new RedirectResponse($this->generateUrl('snide_travinizer_dashboard'));
            } else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors have been found');

            }
        }
        return array(
            'form' => $form->createView(),
            'errors' => $form->getErrors()
        );
    }
1294799
public function newAction(Request $request)
    {
        $role = new Role();
        $form = $this->createForm('CoreBundle\Form\RoleType', $role);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($role);
            $em->flush($role);

            //if come from popup
            if ($request->isXMLHttpRequest()) {         
                return new JsonResponse(array(
                            'id' => $role->getId(), 
                        ));
            }
            $this->get('session')->getFlashBag()->add('success', 'role.created');
            
            return $this->redirectToRoute('core_role_show', array('id' => $role->getId()));
        }

        return array(
            'role' => $role,
            'form' => $form->createView(),
        );
    }
721541
public function createAction(Request $request)
    {
        $form = $this->buildForm();

        if ($request->isMethod('POST') && $this->submitForm($form, $request)->isValid()) {
            try {
                $this->getDomainManager()->create($form->getData());
            } catch (DomainException $e) {
                $this->processException($e);
            }
        }

        return $this->processAction('create', $form, Response::HTTP_CREATED);
    }
488624
public function call(Request $request)
    {
        if($request !== $this->getRequestStack()->getCurrentRequest()){
            $this->getRequestStack()->push($request);
        }

        if(!$request->getRequestFormat(null) && $request->getAcceptableContentTypes()){
            $request->setRequestFormat($request->getFormat($request->getAcceptableContentTypes()[0]));
        }

        $response = $this->getRouter()
                ->find($request)
                ->call($this->getServices());

        if($response instanceof Response){
            return $response;
        }
        return new Response($response);
    }
736290
public function postAction(Request $request)
    {
        $data = array_merge(
            [
                'scheme' => $request->getScheme(),
                'host' => $request->getHost(),
            ],
            array_filter($request->request->all())
        );

        $manager = $this->getTaskManager();
        $task = $this->get('serializer')->deserialize(
            json_encode($data),
            Task::class,
            'json',
            DeserializationContext::create()->setGroups(['api'])
        );
        $task = $manager->create($task);

        $this->getEntityManager()->flush($task);

        return $this->handleView($this->view($task));
    }
1123829
public function resultAction(Request $request)
    {
        try {
            $this
                ->gestpayManager
                ->processResult($request->query->all());
        } catch (PaymentException $e) {
            $this
                ->logger
                ->log(
                    'error',
                    'Gestpay error "'.$e->getMessage(),
                    GestpayMethod::METHOD_NAME
                );
        }

        return new Response('OK');
    }
302508
public function newAction(Request $request)
    {
        $windowMaker = new SellerWindowMaker();
        $form = $this->createForm(new SellerWindowMakerType($this->getCurrentProfile()), $windowMaker);

        if ($response = $this->processForm($request, $form, 'Seller_window_maker_show'))
        {
            return $response;
        }

        return $this->render('HarvestCloudCoreBundle:Seller/WindowMaker:new.html.twig', array(
          'form' => $form->createView(),
        ));
    }