lists all collections.

@param Request $request

@return \Symfony\Component\HttpFoundation\Response
547839
public function cgetAction(Request $request)
    {
        try {
            /** @var ListRestHelperInterface $listRestHelper */
            $listRestHelper = $this->get('sulu_core.list_rest_helper');
            $securityChecker = $this->get('sulu_security.security_checker');

            $flat = $this->getBooleanRequestParameter($request, 'flat', false);
            $depth = $request->get('depth', 0);
            $parentId = $request->get('parentId', null);
            $limit = $request->get('limit', null);
            $offset = $this->getOffset($request, $limit);
            $search = $listRestHelper->getSearchPattern();
            $sortBy = $request->get('sortBy');
            $sortOrder = $request->get('sortOrder', 'ASC');
            $includeRoot = $this->getBooleanRequestParameter($request, 'includeRoot', false, false);
            $collectionManager = $this->getCollectionManager();

            if ('root' === $parentId) {
                $includeRoot = false;
                $parentId = null;
            }

            if ($flat) {
                $collections = $collectionManager->get(
                    $this->getRequestParameter($request, 'locale', true),
                    [
                        'depth' => $depth,
                        'parent' => $parentId,
                    ],
                    $limit,
                    $offset,
                    null !== $sortBy ? [$sortBy => $sortOrder] : []
                );
            } else {
                $collections = $collectionManager->getTree(
                    $this->getRequestParameter($request, 'locale', true),
                    $offset,
                    $limit,
                    $search,
                    $depth,
                    null !== $sortBy ? [$sortBy => $sortOrder] : [],
                    $securityChecker->hasPermission('sulu.media.system_collections', 'view')
                );
            }

            if ($includeRoot && !$parentId) {
                $collections = [
                    new RootCollection(
                        $this->get('translator')->trans('sulu_media.all_collections', [], 'admin'),
                        $collections
                    ),
                ];
            }

            $all = $collectionManager->getCount();

            $list = new ListRepresentation(
                $collections,
                self::$entityKey,
                'get_collections',
                $request->query->all(),
                $listRestHelper->getPage(),
                $listRestHelper->getLimit(),
                $all
            );

            $view = $this->view($list, 200);
        } catch (CollectionNotFoundException $cnf) {
            $view = $this->view($cnf->toArray(), 404);
        } catch (MediaException $me) {
            $view = $this->view($me->toArray(), 400);
        }

        return $this->handleView($view);
    }
866911
public function listAction(Request $request = null)
    {
        if (!$request->get('filter') && !$request->get('filters')) {
            return new RedirectResponse($this->admin->generateUrl('tree', $request->query->all()));
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $datagridValues = $datagrid->getValues();

        $datagridContextIsSet = isset($datagridValues['context']['value']) && !empty($datagridValues['context']['value']);

        //ignore `context` persistent parameter if datagrid `context` value is set
        if ($this->admin->getPersistentParameter('context') && !$datagridContextIsSet) {
            $datagrid->setValue('context', null, $this->admin->getPersistentParameter('context'));
        }

        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        return $this->renderWithExtraParams($this->admin->getTemplate('list'), [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
        ]);
    }
1109058
public function listAction(Request $request)
    {
        $this->buildBreadcrumbs($this->getType());

        $file = new File();
        $form = $this->createForm(FileFormType::class, $file);

        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();

            $em->persist($file);
            $em->flush();

            return $this->redirect($this->generateUrl('clastic_node_list', array(
                'type' => $this->getType(),
            )));
        }

        return $this->render('ClasticMediaBundle:Backoffice:list.html.twig', array(
            'form' => $form->createView(),
            'type' => $this->getType(),
            'module' => $this->get('clastic.module_manager')->getModule($this->getType()),
        ));
    }
1363081
public function listJsonAction(Request $request)
    {
        $totalEntities = $this->countTotal();
                
        $offset = intval($request->get('iDisplayStart'));
        $limit = intval($request->get('iDisplayLength'));
        $sortColumn = intval($request->get('iSortCol_0'));
        $sortDirection = $request->get('sSortDir_0');
        $search = $request->get('sSearch');
        $echo = intval($request->get('sEcho'));
        
        $entities = $this->findAllForDataTables($search, $sortColumn, $sortDirection, null, $request->getLocale());
        
        $totalFilteredEntities = count($entities->getScalarResult());

        // paginate
        $entities->setFirstResult($offset)
            ->setMaxResults($limit);

        $data = $entities->getResult();


        $response = array(
            'iTotalRecords'         => $totalEntities,
            'iTotalDisplayRecords'  => $totalFilteredEntities,
            'sEcho'                 => $echo,
            'aaData'                => $data
        );
        

        return new JsonResponse($response);
    }
420820
public function search(Request $request)
    {
        $input = $request->all();

        $result = $this->repository->search($input);

        return view('cms::modules.files.index')
            ->with('files', $result[0]->get())
            ->with('pagination', $result[2])
            ->with('term', $result[1]);
    }
1171250
public function listAction(Request $request)
    {
        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, SiteInterface::ENTITY_TYPE);
        $mapping = array(
            'name' => 'name'
        );
        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
        $repository =  $this->get('open_orchestra_model.repository.site');

        $siteIds = null;
        if (false === $this->get('security.authorization_checker')->isGranted(ContributionRoleInterface::PLATFORM_ADMIN)) {
            $siteIds = array();
            $availableSites = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getAvailableSites();
            foreach ($availableSites as $site) {
                $siteIds[] = $site->getSiteId();
            }
        }

        $collection = $repository->findForPaginateFilterBySiteIds($configuration, $siteIds);
        $recordsTotal = $repository->countFilterBySiteIds($siteIds);
        $recordsFiltered = $repository->countWithFilterAndSiteIds($configuration, $siteIds);
        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('site_collection', $collection);
        $facade->recordsTotal = $recordsTotal;
        $facade->recordsFiltered = $recordsFiltered;

        return $facade;
    }
1309543
public function index(Request $request)
    {
        $features = $this->service->paginated();
        return view('admin.features.index')->with('features', $features);
    }
390959
public function listAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbCatalogBundle:Storage');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $rep StorageRepository */
        $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Storage');

        return $this->render('AnimeDbCatalogBundle:Storage:list.html.twig', [
            'storages' => $rep->getList(),
        ], $response);
    }
260185
public function indexAction(Request $request)
    {

        $page = $request->get("page", 1);
        $em = $this->getDoctrine()->getManager();
        $dql = "SELECT p FROM AmulenPageBundle:Page p";
        $query = $em->createQuery($dql);
        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate($query, $this->get('request')->query->get('page', $page));

        return array(
            'pagination' => $pagination,
        );
    }
96970
public function index(Request $request)
    {
        $resultSet = collect();

        $pool = (object) config("mentions.pools.{$request->p}");
        $model = app()->make($pool->model);

        $query = $model->where($pool->column, 'LIKE', "%$request->q%");

        if ($filter = isset($pool->filter) ? $pool->filter : null) {
            $query = $filter::handle($query);
        }

        $query->each(function ($record) use ($request, &$resultSet) {
            $record->pool = $request->p;
            $resultSet->push($record);
        });

        $resource = $pool->resource ?: ModelCollection::class;

        return new $resource($resultSet);
    }
1363698
public function listAction(Request $request)
    {
        $theme = $request->attributes->get(
            'synapse_theme',
            $this->container->get('synapse')
                ->enableDefaultTheme()
                ->getCurrentTheme()
        );

        $templateCollection = $this->container->get('synapse.template.loader')
            ->retrieveAll(array(
                'scope' => TemplateInterface::GLOBAL_SCOPE,
                'templateTypeId' => $theme->getTemplateTypes()->column('id')
            ))
        ;
        $templateMap = array();
        foreach ($templateCollection as $template) {
            $templateMap[$template->getTemplateType()->getName()][$template->getContentType()->getName()] = $template;
        }

        return $this->render('SynapseAdminBundle:Template:list.html.twig', array(
            'theme' => $theme,
            'content_types' => $this->container->get('synapse.content_type.loader')
                ->retrieveAll(),
            'templates' => $templateMap,
        ));
    }
1075037
public function cgetAction(Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $list = new CollectionRepresentation(
            $this->getManager()->findAllByLocale($locale),
            self::$entityKey
        );

        $view = $this->view($list, 200);

        return $this->handleView($view);
    }
1000775
public function collectionAction($collection, Request $request = null)
    {
        $action = $this->container->get(CollectionPostArchiveAction::class);

        return $action($this->resolveRequest($request), $collection);
    }
1108375
public function index(Request $request)
    {
        $categories = $this->category->all();

        return Response::json(['errors' => false, 'data' => $categories]);
    }
997935
public function getRouteCollectionForRequest(Request $request)
    {
        $collection = new RouteCollection();
        $path       = $this->getNormalizedPath($request);
        $resource   = $this->repository->findOneBy(['path' => $path]);
        
        if ($resource) {
            $route = $this->createRoute($resource);
            $collection->add(
                self::DYNAMIC_PREFIX . $resource->getId(),
                $route
            );
        }
        
        return $collection;
    }
759214
public function indexAction(Request $request)
    {
        $page = $request->get("page", 1);
        $em = $this->getDoctrine()->getManager();

        $filter = [
            'q' => $request->get('q'),
            'category' => $request->get('filter_category'),
            'is_enabled' => $request->get('is_enabled', true),
        ];

        $qb = $em->getRepository(Product::class)->findAllFilteredQB($filter);

        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate($qb, $page, 40);

        return array(
            'pagination' => $pagination,
            'filter' => $filter,
        );
    }
1180385
public function index(Request $request)
    {
        $categories = $this->repository->allOrSearch($request->get('q'));

        $no = $categories->firstItem();

        return $this->view('categories.index', compact('categories', 'no'));
    }