<commit_before><?php

namespace AppBundle\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;
use MongoDate as MongoDate;
use AppBundle\Manager\ContratManager;
use AppBundle\Repository\SocieteRepository;

class ContratRepository extends DocumentRepository {

    public function findBySociete($societe) {
        return $this->findBy(
                        array('societe' => $societe->getId()),
                        array('dateFin' => 'DESC'));
    }

    public function findByEtablissement($etablissement) {
        return $this->findBy(
                        array('societe' => $etablissement->getSociete()->getId()),
                        array('dateFin' => 'DESC'));
    }

    public function findContratMouvements($societe, $isFacturable, $isFacture) {
        return $this->createQueryBuilder()
             ->field('mouvements.societe')->equals($societe->getId())
             ->field('mouvements.facturable')->equals($isFacturable)
             ->field('mouvements.facture')->equals($isFacture)
             ->getQuery()
             ->execute();
    }

    public function findLast() {
    	return $this->findBy(array(), array('dateCreation' => 'DESC', 'identifiant' => 'DESC'), 100);
    }

    public function findAllSortedByNumeroArchive() {
       return $this->findBy(array(), array('numeroArchive' => 'ASC'));
    }

    public function findAllTaciteSortedByNumeroArchive($dateMin) {
      return $this->createQueryBuilder()
           ->field('typeContrat')->equals(ContratManager::TYPE_CONTRAT_RECONDUCTION_TACITE)
           ->field('dateDebut')->gte($dateMin)
           ->sort('numeroArchive', 'asc')
           ->getQuery()
           ->execute();
    }<commit_msg>Limite d'élements dans le listing<commit_after><?php

namespace AppBundle\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;
use MongoDate as MongoDate;
use AppBundle\Manager\ContratManager;
use AppBundle\Repository\SocieteRepository;

class ContratRepository extends DocumentRepository {

    public function findBySociete($societe) {
        return $this->findBy(
                        array('societe' => $societe->getId()),
                        array('dateFin' => 'DESC'));
    }

    public function findByEtablissement($etablissement) {
        return $this->findBy(
                        array('societe' => $etablissement->getSociete()->getId()),
                        array('dateFin' => 'DESC'));
    }

    public function findContratMouvements($societe, $isFacturable, $isFacture) {
        return $this->createQueryBuilder()
             ->field('mouvements.societe')->equals($societe->getId())
             ->field('mouvements.facturable')->equals($isFacturable)
             ->field('mouvements.facture')->equals($isFacture)
             ->getQuery()
             ->execute();
    }

    public function findLast() {
    	return $this->findBy(array(), array('dateCreation' => 'DESC', 'identifiant' => 'DESC'), 300);
    }

    public function findAllSortedByNumeroArchive() {
       return $this->findBy(array(), array('numeroArchive' => 'ASC'));
    }

    public function findAllTaciteSortedByNumeroArchive($dateMin) {
      return $this->createQueryBuilder()
           ->field('typeContrat')->equals(ContratManager::TYPE_CONTRAT_RECONDUCTION_TACITE)
           ->field('dateDebut')->gte($dateMin)
           ->sort('numeroArchive', 'asc')
           ->getQuery()
           ->execute();
    }
{'fraction_non_alphanumeric': 0.1455659276546091, 'fraction_numerical': 0.001750291715285881, 'mean_word_length': 2.8312849162011173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, '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': '2137863', 'n_tokens_mistral': 1028, 'n_tokens_neox': 979, 'n_words': 154}