I'm trying to paginate a query that uses DQL (because I'm going to use some group functions like sum) and has an outer join, here a simplified code:
//in controller
use
Pagerfanta\Pagerfanta,
Pagerfanta\Adapter\DoctrineORMAdapter as…
I am trying to move from phpdoc to psalm and I am getting weird error with its template based returns.
class Message {}
interface FooInterface
{
/** @return Pagerfanta|Message[] */
public function getMessages(): Pagerfanta;
}
This is…
I am running MySQL 5.7 on both my server and my local machine. I am using Symfony 4.4 and Doctrine.
On my dev machine the following query (with the same DB dumped from the server) executes in ~2s, while it takes 35s+ on the server.
I assume this is…
i have an app, which displays a list of items, in the main page i have add form with two inputs,
the first will contain the month value and the second one will take a year value;
i set up the action inside the controller in that action there is a…
I have the following code:
public function adminListAction(Request $request)
{
if (!$this->isGranted('ROLE_ADMIN')) {
return new JsonResponse("Not granted");
}
$page = $request->query->get('page', 1);
$criteria = new…
I'm working on a RESTFull API with Symfony and FOSRESTBundle. I use the JMS Serializer with groups to show differents fields depending on the context.
For listing my resources, I want implement PagerFantaBundle. All work fine except that PagerFanta…
In an application built on the symfony 4 framwork, I use a query in my user repository to find users with a specific role, that looks like this:
public function findByRole($role)
{
$qb = $this->_em->createQueryBuilder();
$qb->select('u')
…
I'm trying to serialize object to json by following symfony official docs.
I'v got Pagerfanta object(getting it from repository just like in Demo Application)
public function findOneIncRel(int $page = 1): Pagerfanta
{
$query =…
In my Demo application, use Pagerfanta to read only a few rows from Database.
public function findAllProductsByCategory($category, int $page = 1): Pagerfanta
{
// DQL = Always select full classes from classes
$query =…
I'm using pagerfanta with symfony 4.
I'm paginating DoctrineORM results with pagerfanta.
I want to paginate search results, without query params it's all working great :
{{ pagerfanta(articles, 'twitter_bootstrap4_translated', {routeName:…
I have strange problem here but first a quick explanation of what is the idea. We have system where all users can upload files. Each user will have favorite files and I need to add pagination.
My User entity:
/**
* User
*
*…
I'm trying to get the fieldname of a pagerfanta results.
Twig template
{% for post in posts %}
{{ dump(post) }}
{% endfor %}
The dump result is:
Users {#764 ▼
-iduser: 11
-username: "xzvdsfg"
-password: "SHHHHHH"
-lastlogin: DateTime {#691…
i trying to create a paginator when i display products but the $paginator->setMaxPerPage() and $paginator->setCurrentPage() are not working :
my repository method :
public function findLatestBySubcategAndTaxon($ids, $taxon_id)
{
$sids =…
Is it posible to set the route / render controller with pager fanta in symfony2 because i have tried rendering a controller and it hits me with cannot generate route:
An exception has been thrown during the rendering of a template ("Unable to…
I have a mysql database blog with 21 posts in it.
I set $maxPerPage = '3'; So I get 7 pages, but from page 4 I get the following error:
OutOfRangeCurrentPageException: Page "4" does not exist. The currentPage must be inferior to "3"
Here's my code:
…