<commit_before><?php

namespace Application\ChangementsBundle\Entity;

use Doctrine\ORM\Query\ResultSetMapping;
use CalendR\Extension\Doctrine2\QueryHelper;
use Doctrine\ORM\EntityRepository;
use CalendR\Event\Provider\ProviderInterface;
use DoctrineExtensions\Query\Mysql\GroupConcat;
use Application\ChangementsBundle\Entity\Changements;
use Application\ChangementsBundle\Query\Mysql\AtGroupConcat;

//use CalendR\Extension\Doctrine2\EventRepository as EventRepositoryTrait;
/**
 * NotesRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ChangementsRepository extends EntityRepository implements ProviderInterface {

    protected $query;

    public function get_all_months() {
        return array(
            'Jan', 'Feb', 'Mar', 'Apr',
            'May', 'Jun', 'Jul', 'Aug',
            'Sep', 'Oct', 'Nov', 'Dec'
        );
    }

    public function getProjetsForRequeteBuilder() {
        $query = $this->createQueryBuilder('a')
                ->select('distinct b.id,b.nomprojet')
                //   ->from('Application\ChangementsBundle\Entity\Changements', 'a')
                ->leftJoin('a.idProjet', 'b')
                ->groupBy('b.id')
                ->add('orderBy', 'b.nomprojet ASC');

        $choices = array();

        //  print_r($results);exit(1);
        $arr=$query->getQuery()->getArrayResult();
        foreach ($arr as $result) {
            $choices[$result['id']] = $result['nomprojet'];
        }
       // print_r($choices);exit(1);
        return $choices;

        //return $query->getQuery()->getArrayResult();
    }

    public function getDemandeursForRequeteBuilder() {
        $query = $this->createQueryBuilder('a')
                ->select('distinct b.id,b.nomUser')
                // ->from('Application\ChangementsBundle\Entity\Changements', 'a')<commit_msg>sf23:  essais left join fanta et knppaginator<commit_after><?php

namespace Application\ChangementsBundle\Entity;

use Doctrine\ORM\Query\ResultSetMapping;
use CalendR\Extension\Doctrine2\QueryHelper;
use Doctrine\ORM\EntityRepository;
use CalendR\Event\Provider\ProviderInterface;
use DoctrineExtensions\Query\Mysql\GroupConcat;
use Application\ChangementsBundle\Entity\Changements;
use Application\ChangementsBundle\Query\Mysql\AtGroupConcat;

//use CalendR\Extension\Doctrine2\EventRepository as EventRepositoryTrait;
/**
 * NotesRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ChangementsRepository extends EntityRepository implements ProviderInterface {

    protected $query;

    public function get_all_months() {
        return array(
            'Jan', 'Feb', 'Mar', 'Apr',
            'May', 'Jun', 'Jul', 'Aug',
            'Sep', 'Oct', 'Nov', 'Dec'
        );
    }

    /*
     * TODO: ajouter les filtres
     * 
     */
    public function getProjetsForRequeteBuilder() {
        $query = $this->createQueryBuilder('a')
                ->select('distinct b.id,b.nomprojet')
                //   ->from('Application\ChangementsBundle\Entity\Changements', 'a')
                ->leftJoin('a.idProjet', 'b')
                ->groupBy('b.id')
                ->add('orderBy', 'b.nomprojet ASC');

        $choices = array();

        //  print_r($results);exit(1);
        $arr=$query->getQuery()->getArrayResult();
        foreach ($arr as $result) {
            $choices[$result['id']] = $result['nomprojet'];
        }
       // print_r($choices);exit(1);
        return $choices;

        //return $query->getQuery()->getArrayResult();
    }

    public function getDemandeursForRequeteBuilder() {
        $query = $this->createQueryBuilder('a')
                ->select('distinct b.id,b.nomUser')
                // ->from('Application\ChangementsBundle\Entity\Changements', 'a')
{'fraction_non_alphanumeric': 0.14063310845874416, 'fraction_numerical': 0.002594706798131811, 'mean_word_length': 2.801775147928994, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '3109523', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1122, 'n_words': 211}