<commit_before><?php

/**
 * Model for Facture
 *
 */
class DS extends BaseDS implements InterfaceDeclarant {

    protected $declarant = null;

    public function  __construct() {
        parent::__construct();   
        $this->declarant = new Declarant($this);
    }
    
    public function getLastDRM() {
        return DRMClient::getInstance()->findLastByIdentifiantAndCampagne($this->identifiant, $this->campagne);
    }

    public function updateProduits() {
        $drm = $this->getLastDRM();
        $produits = $drm->getDetails();

        foreach ($produits as $produit) {
            $produitDs = $this->declarations->add($produit->getHashForKey());
            $produitDs->updateProduit($produit);
        }
    }

    public function getEtablissementObject() {
        return $this->declarant->getEtablissementObject();
    }

    public function storeDeclarant() {
        $this->declarant->storeDeclarant();
    }
    
    public function isStatutValide() {
        return $this->statut === DSClient::STATUT_VALIDE;
    }
    
    public function isStatutPartiel() {
        return $this->statut === DSClient::STATUT_VALIDE_PARTIEL;
    }
    
    public function isStatutASaisir() {
        return $this->statut === DSClient::STATUT_A_SAISIR;
    }
    
    public function updateStatut() {
        $this->statut = DSClient::STATUT_VALIDE;
        foreach ($this->declarations as $declaration) {
            if(is_null($declaration->stock_revendique) || $declaration->stock_revendique == 0)
            {<commit_msg>Renommage de Declarant en DeclarantDocument<commit_after><?php

/**
 * Model for Facture
 *
 */
class DS extends BaseDS implements InterfaceDeclarantDocument {

    protected $declarant_document = null;

    public function  __construct() {
        parent::__construct();   
        $this->declarant_document = new DeclarantDocument($this);
    }

    public function constructId() {
        $this->valide->statut = SV12Client::STATUT_BROUILLON;
        $this->campagne = SV12Client::buildCampagne($this->periode);
        $this->set('_id', SV12Client::getInstance()->buildId($this->identifiant, 
                                                            $this->periode, 
                                                            $this->version));
    }
    
    public function getLastDRM() {
        return DRMClient::getInstance()->findLastByIdentifiantAndCampagne($this->identifiant, $this->campagne);
    }

    public function updateProduits() {
        $drm = $this->getLastDRM();
        $produits = $drm->getDetails();

        foreach ($produits as $produit) {
            $produitDs = $this->declarations->add($produit->getHashForKey());
            $produitDs->updateProduit($produit);
        }
    }

    public function getEtablissementObject() {
        return $this->declarant_document->getEtablissementObject();
    }

    public function storeDeclarant() {
        $this->declarant_document->storeDeclarant();
    }
    
    public function isStatutValide() {
        return $this->statut === DSClient::STATUT_VALIDE;
    }
    
    public function isStatutPartiel() {
        return $this->statut === DSClient::STATUT_VALIDE_PARTIEL;
    }
    
    public function isStatutASaisir() {
        return $this->statut === DSClient::STATUT_A_SAISIR;
    }
    
    public function updateStatut() {
        $this->statut = DSClient::STATUT_VALIDE;
        foreach ($this->declarations as $declaration) {
            if(is_null($declaration->stock_revendique) || $declaration->stock_revendique == 0)
            {
{'fraction_non_alphanumeric': 0.1247546958228203, 'fraction_numerical': 0.00224278104850014, 'mean_word_length': 2.560878243512974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7287842', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1024, 'n_words': 173}