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

class Vrac extends BaseVrac {

    protected $archivage_document = null;

    public function  __construct() {
        parent::__construct();   
        $this->initDocuments();
    }

    public function __clone() {
        parent::__clone();
        $this->initDocuments();
    }   

    protected function initDocuments() {
        $this->archivage_document = new ArchivageDocument($this);
    }
    
    public function constructId() {
        $this->set('_id', 'VRAC-'.$this->numero_contrat);

        if(!$this->date_signature) {
            $this->date_signature = date('d/m/Y');
        }
        
        if(!$this->date_campagne) {
            $this->date_campagne = date('d/m/Y');
        }
    }

    public function getCampagne() {

        return $this->_get('campagne');
    } 

    public function setNumeroContrat($value) {
        $this->_set('numero_contrat', $value);
    }

    public function setProduit($value) {
        $this->_set('produit', $value);
        $this->produit_libelle = $this->getProduitObject()->getLibelleFormat(array(), "%g% %a% %m% %l% %co% %ce%");
    }
    
    public function setBouteillesContenanceLibelle($c) {
        $this->_set('bouteilles_contenance_libelle', $c);
        if ($c) {
	  $this->setBouteillesContenanceVolume(VracClient::getInstance()->getContenance($c));
        }
    }<commit_msg>Adaptation au formatage du libellé stocké en conf<commit_after><?php
/**
 * Model for Vrac
 *
 */

class Vrac extends BaseVrac {

    protected $archivage_document = null;

    public function  __construct() {
        parent::__construct();   
        $this->initDocuments();
    }

    public function __clone() {
        parent::__clone();
        $this->initDocuments();
    }   

    protected function initDocuments() {
        $this->archivage_document = new ArchivageDocument($this);
    }
    
    public function constructId() {
        $this->set('_id', 'VRAC-'.$this->numero_contrat);

        if(!$this->date_signature) {
            $this->date_signature = date('d/m/Y');
        }
        
        if(!$this->date_campagne) {
            $this->date_campagne = date('d/m/Y');
        }
    }

    public function getCampagne() {

        return $this->_get('campagne');
    } 

    public function setNumeroContrat($value) {
        $this->_set('numero_contrat', $value);
    }

    public function setProduit($value) {
        $this->_set('produit', $value);
        $this->produit_libelle = $this->getProduitObject()->getLibelleFormat(array(), "%format_libelle%");
    }
    
    public function setBouteillesContenanceLibelle($c) {
        $this->_set('bouteilles_contenance_libelle', $c);
        if ($c) {
	  $this->setBouteillesContenanceVolume(VracClient::getInstance()->getContenance($c));
        }
    }
{'fraction_non_alphanumeric': 0.1549345596038203, 'fraction_numerical': 0.0, 'mean_word_length': 2.548306148055207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '5423385', 'n_tokens_mistral': 908, 'n_tokens_neox': 880, 'n_words': 140}