Sulu\Bundle\ResourceBundle\Controller\FilterController::putAction PHP Method

putAction() public method

Change a filter by the given id.
public putAction ( Request $request, integer $id ) : Response
$request Symfony\Component\HttpFoundation\Request
$id integer the attribute id
return Symfony\Component\HttpFoundation\Response
    public function putAction(Request $request, $id)
    {
        try {
            $filter = $this->getManager()->save($request->request->all(), $this->getRequestParameter($request, 'locale', true), $this->getUser()->getId(), $id);
            $view = $this->view($filter, 200);
        } catch (FilterDependencyNotFoundException $e) {
            $exception = new EntityNotFoundException($e->getEntityName(), $e->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (FilterNotFoundException $e) {
            $exception = new EntityNotFoundException($e->getEntityName(), $e->getId());
            $view = $this->view($exception->toArray(), 404);
        } catch (MissingFilterException $e) {
            $exception = new MissingArgumentException(self::$entityName, $e->getFilter());
            $view = $this->view($exception->toArray(), 400);
        } catch (ConditionGroupMismatchException $e) {
            $exception = new InvalidArgumentException(self::$groupConditionEntityName, $e->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (UnknownContextException $e) {
            $exception = new RestException($e->getMessage());
            $view = $this->view($exception->toArray(), 400);
        }
        return $this->handleView($view);
    }