<commit_before><?php

namespace Blog\Repository;

use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;

class ArticleRepository extends EntityRepository
{

    public function getArticlePaginator($offset = 0, $max = 5)
    {
        $qb = $this->createQueryBuilder('a')
            ->where('a.state = :state')
            ->setParameter('state', true)
            ->orderBy('a.date', 'DESC')
            ->setFirstResult(($offset - 1) * $max)
            ->setMaxResults($max);

        $paginator = new Paginator($qb,false);

        return $paginator;
    }

    public function getArticleCount()
    {
        return $this->createQueryBuilder('a')->select('count(a)')->getQuery()->getSingleScalarResult();
    }

}<commit_msg>fix requete sur les articles en front<commit_after><?php

namespace Blog\Repository;

use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;

class ArticleRepository extends EntityRepository
{

    public function getArticlePaginator($offset = 0, $max = 5)
    {
        $qb = $this->createQueryBuilder('a')
            ->where('a.state = :state')
            ->setParameter('state', true)
            ->orderBy('a.date', 'DESC')
            ->setFirstResult(($offset - 1) * $max)
            ->setMaxResults($max);

        $paginator = new Paginator($qb,false);

        return $paginator;
    }

    public function getArticleCount()
    {
        $qb = $this->createQueryBuilder('a');

        $qb->select('count(a)')
            ->where('a.state = :state')
            ->setParameter('state', true);

        return $qb->getQuery()->getSingleScalarResult();
    }

}
{'fraction_non_alphanumeric': 0.14930555555555555, 'fraction_numerical': 0.003472222222222222, 'mean_word_length': 2.7505422993492408, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7655388', 'n_tokens_mistral': 528, 'n_tokens_neox': 512, 'n_words': 95}