Returns all records

@param Request $request Current http request

@return \Symfony\Component\HttpFoundation\Response $response Response with result or error
347723
public function allAction(Request $request)
    {
        $model = $this->getModel();

        $content = $this->restUtils->serialize($model->findAll($request));

        $response = $this->getResponse()
            ->setStatusCode(Response::HTTP_OK)
            ->setContent($content);

        return $response;
    }
1338365
public function get_items( $request ) {

		// Retrieve the list of registered collection query parameters.
		$registered = $this->get_collection_params();

		if ( isset( $registered['type'] ) && ! empty( $request['type'] ) ) {
			$taxonomies = get_object_taxonomies( $request['type'], 'objects' );
		} else {
			$taxonomies = get_taxonomies( '', 'objects' );
		}
		$data = array();
		foreach ( $taxonomies as $tax_type => $value ) {
			if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap->manage_terms ) ) ) {
				continue;
			}
			$tax = $this->prepare_item_for_response( $value, $request );
			$tax = $this->prepare_response_for_collection( $tax );
			$data[ $tax_type ] = $tax;
		}

		if ( empty( $data ) ) {
			// Response should still be returned as a JSON object when it is empty.
			$data = (object) $data;
		}

		return rest_ensure_response( $data );
	}
4836
public function resolve(Request $request)
    {
        $request->databaseQueries = array_merge($request->databaseQueries, $this->getDatabaseQueries());

        return $request;
    }
867343
public function get_items( $request ) {

		// Register missing routes
		$this->registerRouteDependencies();

		if ( ! empty( $request['search'] ) ) {
			$response = rest_ensure_response( $this->searchBooks( $request ) );
			$this->addNextSearchLinks( $request, $response );
		} else {
			$response = rest_ensure_response( $this->listBooks( $request ) );
			$this->addPreviousNextLinks( $request, $response );
		}

		return $response;
	}
407793
public function pagesListAction(Request $request)
    {
        $repository = $this->get('ekyna_cms.page.repository');

        $lastModifiedAt = $repository->getLastUpdatedAt();

        $response = new Response();
        $response->headers->set('Content-Type', 'application/json');
        $response->setLastModified($lastModifiedAt);

        if ($response->isNotModified($request)) {
            return $response;
        }

        $documentLocale = $request->query->get('document_locale', $request->getLocale());
        $list = [];

        /** @var \Ekyna\Bundle\CmsBundle\Model\PageInterface[] $pages */
        $pages = $this
            ->get('ekyna_cms.page.repository')
            ->findBy(['dynamicPath' => false], ['left' => 'ASC']);

        foreach ($pages as $page) {
            $list[] = $this->pageToArray($page, $documentLocale);
        }

        return $response->setContent(json_encode($list));
    }
98780
public function cgetAction(Request $request)
    {
        $serializationGroups = [];
        $locale = $this->getLocale($request);

        if ('true' == $request->get('flat')) {
            $list = $this->getList($request, $locale);
        } else {
            if (true == $request->get('bySystem')) {
                $contacts = $this->getContactsByUserSystem();
                $serializationGroups[] = 'select';
            } else {
                $contacts = $this->getDoctrine()->getRepository(
                    $this->container->getParameter('sulu.model.contact.class')
                )->findAll();
                $serializationGroups = array_merge(
                    $serializationGroups,
                    static::$contactSerializationGroups
                );
            }
            // convert to api-contacts
            $apiContacts = [];
            foreach ($contacts as $contact) {
                $apiContacts[] = $this->getContactManager()->getContact($contact, $locale);
            }

            $exclusion = null;
            if (count($serializationGroups) > 0) {
                $exclusion = new Exclusion($serializationGroups);
            }

            $list = new CollectionRepresentation($apiContacts, self::$entityKey, null, $exclusion, $exclusion);
        }

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

        // set serialization groups
        if (count($serializationGroups) > 0) {
            $context = new Context();
            $context->setGroups($serializationGroups);
            $view->setContext($context);
        }

        return $this->handleView($view);
    }
860874
public function indexAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbCatalogBundle:Item');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        // current page for paging
        $page = $request->get('page', 1);
        $current_page = $page > 1 ? $page : 1;

        /* @var $rep ItemRepository */
        $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Item');
        /* @var $controls ListControls */
        $controls = $this->get('anime_db.item.list_controls');

        $pagination = null;
        // show not all items
        if ($limit = $controls->getLimit($request->query->all())) {
            $that = $this;
            $query = $request->query->all();
            unset($query['page']);
            $pagination = $this->get('anime_db.pagination')
                ->create(ceil($rep->count() / $limit), $current_page)
                ->setPageLink(function ($page) use ($that, $query) {
                    return $that->generateUrl('home', array_merge($query, ['page' => $page]));
                })
                ->setFirstPageLink($this->generateUrl('home', $query))
                ->getView();
        }

        // get items
        $items = $rep->getList($limit, ($current_page - 1) * $limit);

        return $this->render('AnimeDbCatalogBundle:Home:index.html.twig', [
            'items' => $items,
            'pagination' => $pagination,
            'widget_top' => self::WIDGET_PALCE_TOP,
            'widget_bottom' => self::WIDGET_PALCE_BOTTOM,
        ], $response);
    }
350665
protected function getTermData(Request $request)
    {
        $data = [];

        foreach ($this->repository as $field) {
            $data[$field->getName()] = $request->get($field->getName());
        }

        return $data;
    }
494840
public static function getIndexRecords($request, $parameters)
    {
        $instance = new static;

        if(method_exists($instance, 'addToGetIndexRecords'))
            $query = $instance->addToGetIndexRecords($request, $parameters);
        else
            if(method_exists($instance, 'scopeBuilder'))
                $query = $instance->builder();
            else
                $query = $instance->query();

        $query = Miscellaneous::getQueryWhere($request, $query, $parameters);

        if(isset($parameters['count']) &&  $parameters['count'])
        {
            // if we need count results
            if(method_exists($instance, 'customCountIndexRecords'))
                return $instance->customCountIndexRecords($query, $parameters);
            else
                return $query->count();
        }
        else
        {
            // if we need limit and order results
            if(isset($parameters['length']))
                $query->take($parameters['length']);

            if(isset($parameters['start']))
                $query->skip($parameters['start']);

            if(isset($parameters['order']) && is_array($parameters['order']))
                $query->orderBy($parameters['order']['column'], isset($parameters['order']['dir'])? $parameters['order']['dir'] : 'asc');


            if(method_exists($instance, 'getCustomReturnIndexRecords'))
            {
                // if we need a custom get()
                return $instance->getCustomReturnIndexRecords($query, $parameters);
            }
            else
            {
                // if has diplayColumns variable
                if(isset($parameters['displayColumns']) && is_array($parameters['displayColumns']) && count($parameters['displayColumns']) > 0)
                    return $query->get($parameters['displayColumns']);
                else
                    return $query->get();
            }
        }
    }
1067412
protected function getStateDataFromRequest(Request $request)
    {
        $requestData = array_merge_recursive($request->query->all(), $request->request->all());

        $requestData = $this->requestExtractorCollection->extract($this->configuration->getAsArray(), $requestData, $this->sModuleSpotName);

        return $requestData;
    }
386175
public static function getAllParams(Request $request)
    {
        $params = array();
        $get = Utils::getParams($request, Utils::$METHOD_GET);
        if($get !== null && count($get) > 0)
        {
            $params[Utils::$METHOD_GET] = $get;
        }
        $post = Utils::getParams($request, Utils::$METHOD_POST);
        if($post !== null && count($post) > 0)
        {
            $params[Utils::$METHOD_POST] = $post;
        }
        if($request->getContent() !== null && strlen($request->getContent()) > 0)
        {
            $params[Utils::$CONTENT] = $request->getContent();
        }
        return $params;
    }
1356733
public function getAll(Request $request)
    {
        /**
         * Set workspace identifier
         */
        \PDFGeneratorAPI::setWorkspace($this->userRepository->getWorkspaceIdentifier(Auth::user()));

        $templates = collect(\PDFGeneratorAPI::getAll());
        return response()->json([
            'private' => $templates->filter(function($t) {
                return $t->owner;
            })->values(),
            'default' => $templates->filter(function($t) {
                return !$t->owner;
            })->values()
        ]);
    }
261982
public function getAll(Request $request)
    {
        $this->authorize(MediasPolicy::PERMISSION_LIST);

        return $this->jsonResponseSuccess([
            'medias' => $this->media->all(
                $request->get('location', '/')
            ),
        ]);
    }
445335
public function cgetAction(Request $request)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        $queryString = $request->get('query');

        if ($request->get('flat') == 'true') {
            $list = $this->getListRepresentation($request);
        } else {
            $list = new CollectionRepresentation(
                $this->getManager()->findAllByLocaleAndQueryString($locale, $queryString),
                self::$entityKey
            );
        }

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

        return $this->handleView($view);
    }
1136992
private function getRequestedPage(Request $request)
    {
        $pageNumber = $request->query->getInt('page', 1);
        if (!$pageNumber || $pageNumber < 1) {
            $pageNumber = 1;
        }

        return $pageNumber;
    }
1302215
public function cgetAction(Request $request)
    {
        if ('true' == $request->get('flat')) {
            /** @var RestHelperInterface $restHelper */
            $restHelper = $this->get('sulu_core.doctrine_rest_helper');

            /** @var DoctrineListBuilderFactory $factory */
            $factory = $this->get('sulu_core.doctrine_list_builder_factory');

            $tagEntityName = $this->getParameter('sulu.model.tag.class');

            $fieldDescriptors = $this->get('sulu_core.list_builder.field_descriptor_factory')
                ->getFieldDescriptors('tags');
            $listBuilder = $factory->create($tagEntityName);

            $names = array_filter(explode(',', $request->get('names', '')));
            if (count($names) > 0) {
                $listBuilder->in($fieldDescriptors['name'], $names);
            }

            $restHelper->initializeListBuilder($listBuilder, $fieldDescriptors);

            $list = new ListRepresentation(
                $listBuilder->execute(),
                self::$entityKey,
                'get_tags',
                $request->query->all(),
                $listBuilder->getCurrentPage(),
                $listBuilder->getLimit(),
                $listBuilder->count()
            );
            $view = $this->view($list, 200);
        } else {
            $list = new CollectionRepresentation($this->getManager()->findAll(), self::$entityKey);

            $context = new Context();
            $context->setGroups(['partialTag']);
            $view = $this->view($list, 200)->setContext($context);
        }

        return $this->handleView($view);
    }
264157
protected function filter($request)
	{
		return $this->_applyFilter($this->_responses,
			$this->_controller->execute(
				$this->_applyFilter($this->_requests, $request)
				));
	}