Ojs\ApiBundle\Controller\Admin\IndexRestController::postIndexesAction PHP Метод

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

Create a Index from the submitted data.
public postIndexesAction ( Request $request ) : Symfony\Component\Form\FormTypeInterface | FOS\RestBundle\Controller\Annotations\View
$request Symfony\Component\HttpFoundation\Request the request object
Результат Symfony\Component\Form\FormTypeInterface | FOS\RestBundle\Controller\Annotations\View
    public function postIndexesAction(Request $request)
    {
        if (!$this->isGranted('CREATE', new Index())) {
            throw new AccessDeniedException();
        }
        try {
            $newEntity = $this->container->get('ojs_api.index.handler')->post($request->request->all());
            $routeOptions = array('id' => $newEntity->getId(), '_format' => $request->get('_format'));
            return $this->routeRedirectView('api_1_get_indexs', $routeOptions, Codes::HTTP_CREATED);
        } catch (InvalidFormException $exception) {
            return $exception->getForm();
        }
    }