Ojs\ApiBundle\Controller\Admin\PublisherThemeRestController::patchPublisherthemeAction PHP 메소드

patchPublisherthemeAction() 공개 메소드

Update existing publisher_theme from the submitted data or create a new publisher_theme at a specific location.
public patchPublisherthemeAction ( Request $request, integer $id ) : Symfony\Component\Form\FormTypeInterface | FOS\RestBundle\Controller\Annotations\View
$request Symfony\Component\HttpFoundation\Request the request object
$id integer the publisher_theme id
리턴 Symfony\Component\Form\FormTypeInterface | FOS\RestBundle\Controller\Annotations\View
    public function patchPublisherthemeAction(Request $request, $id)
    {
        try {
            $entity = $this->container->get('ojs_api.publisher_theme.handler')->patch($this->getOr404($id), $request->request->all());
            if (!$this->isGranted('EDIT', $entity)) {
                throw new AccessDeniedException();
            }
            $routeOptions = array('id' => $entity->getId(), '_format' => $request->get('_format'));
            return $this->routeRedirectView('api_1_get_persontitle', $routeOptions, Codes::HTTP_NO_CONTENT);
        } catch (InvalidFormException $exception) {
            return $exception->getForm();
        }
    }