<commit_before><?php
/**
 * Model for Generation
 *
 */

class Generation extends BaseGeneration {
  const GENERATION_STATUT_ENCOURS = "En cours";
  const GENERATION_STATUT_GENERE = "Généré";

  public function constructId() {
    $this->setDateEmission(date('YmdHis'));
    $this->setIdentifiant($this->type_document.'-'.$this->date_emission);
    $this->set_id('GENERATION-'.$this->identifiant);
    $this->setStatut(self::GENERATION_STATUT_ENCOURS);
  }

  public function save() {
    $this->nb_documents = count($this->documents);
    if (count($this->fichier)) {
      $this->setStatut(self::GENERATION_STATUT_GENERE);
    }
    parent::save();
  }
  
  public function __toString() {
     return GenerationClient::getInstance()->getDateFromIdGeneration($this->_id);
  }
  <commit_msg>Constante pour les factures<commit_after><?php
/**
 * Model for Generation
 *
 */

class Generation extends BaseGeneration {
  const GENERATION_STATUT_ENCOURS = "En cours";
  const GENERATION_STATUT_GENERE = "Généré";
  const GENERATION_TYPE_DOCUMENT_FACTURE = 'factures';

  public function constructId() {
    $this->setDateEmission(date('YmdHis'));
    $this->setIdentifiant($this->type_document.'-'.$this->date_emission);
    $this->set_id('GENERATION-'.$this->identifiant);
    $this->setStatut(self::GENERATION_STATUT_ENCOURS);
  }

  public function save() {
    $this->nb_documents = count($this->documents);
    if (count($this->fichiers)) {
      $this->setStatut(self::GENERATION_STATUT_GENERE);
    }
    parent::save();
  }
  
  public function __toString() {
     return GenerationClient::getInstance()->getDateFromIdGeneration($this->_id);
  }
  
{'fraction_non_alphanumeric': 0.15375302663438256, 'fraction_numerical': 0.0, 'mean_word_length': 4.622448979591836, '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': '2127234', 'n_tokens_mistral': 551, 'n_tokens_neox': 540, 'n_words': 78}