<commit_before><?php

namespace WBB\BarBundle\Repository;

use WBB\CoreBundle\Repository\EntityRepository;

/**
 * NewsRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class NewsRepository extends EntityRepository
{
    public function findLatestNews($city=null, $limit = 3)
    {
        $qb = $this->createQuerybuilder($this->getAlias());

        $qb
            ->select($this->getAlias())
            ->leftJoin($this->getAlias().'.cities', 'c')
            ->where($qb->expr()->eq($this->getAlias().'.isOnTop', $qb->expr()->literal(true)))
            ->orderBy($this->getAlias().'.createdAt', 'DESC')
            ->setMaxResults($limit)
        ;

        if($city){
            $qb->andWhere($qb->expr()->eq('c.id', $city->getId()));
        }

        return $qb->getQuery()->getResult();
    }
} <commit_msg>Articles<commit_after><?php

namespace WBB\BarBundle\Repository;

use WBB\CoreBundle\Repository\EntityRepository;

/**
 * NewsRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class NewsRepository extends EntityRepository
{
    public function findLatestNews($city=null, $limit = 3)
    {
        $qb = $this->createQuerybuilder($this->getAlias());

        $qb
            ->select($this->getAlias())
            ->where($qb->expr()->eq($this->getAlias().'.isOnTop', $qb->expr()->literal(true)))
            ->orderBy($this->getAlias().'.createdAt', 'DESC')
            ->setMaxResults($limit)
        ;

        if($city){
            $qb
                ->leftJoin($this->getAlias().'.cities', 'c')
                ->andWhere($qb->expr()->eq('c.id', $city->getId()));
        }

        return $qb->getQuery()->getResult();
    }
} 
{'fraction_non_alphanumeric': 0.1858902575587906, 'fraction_numerical': 0.0011198208286674132, 'mean_word_length': 2.5597609561752988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '4035229', 'n_tokens_mistral': 541, 'n_tokens_neox': 534, 'n_words': 93}