public function cgetAction(Request $request)
{
try {
// check if context exists and filters are enabled for the given context
$context = $request->get('context');
if (!$this->getManager()->hasContext($context)) {
throw new UnknownContextException($context);
}
if (!$this->getManager()->isFeatureEnabled($context, 'filters')) {
throw new MissingFeatureException($context, 'filters');
}
if ($request->get('flat') == 'true') {
$list = $this->getListRepresentation($request);
} else {
$list = new CollectionRepresentation($this->getManager()->findFiltersForUserAndContext($context, $this->getUser()->getId(), $this->getRequestParameter($request, 'locale', true)), self::$entityKey);
}
$view = $this->view($list, 200);
} catch (UnknownContextException $exc) {
$exception = new RestException($exc->getMessage());
$view = $this->view($exception->toArray(), 400);
} catch (MissingFeatureException $exc) {
$exception = new RestException($exc->getMessage());
$view = $this->view($exception->toArray(), 400);
}
return $this->handleView($view);
}