<commit_before><?php

class Mouvement
{
    public function getMD5Key() {
        $key = $this->produit_hash . $this->type_hash . $this->detail_identifiant;
        if ($this->detail_identifiant)
            $key.= uniqid();
        return md5($key);
    }
}<commit_msg>- mis en commun entre la DRM et la SV12 de la classe Mouvement<commit_after><?php

abstract class Mouvement extends acCouchdbDocumentTree
{
    public function setProduitHash($value) {
        $this->_set('produit_hash',  $value);
        $this->produit_libelle = $this->getProduitConfig()->getLibelleFormat(array(), "%g% %a% %m% %l% %co% %ce%");
    }

    public function facturer() {
        $this->facture = 1;
    }

    public function defacturer() {
        $this->facture = 0;
    }

    public function getMD5Key() {
        $key = $this->getDocument()->identifiant . $this->produit_hash . $this->type_hash . $this->detail_identifiant;
        if ($this->detail_identifiant)
            $key.= uniqid();
        
        return md5($key);
    }

    public function isFacturable() {
        
        return $this->facturable;
    }

    public function isVrac() {

        return $this->vrac_numero;
    }

    public function getVrac() {

        if (!$this->isVrac()) {
            return null;
        }

        $vrac = VracClient::getInstance()->findByNumContrat($this->vrac_numero);

        if (!$vrac) {

            throw new sfException(sprintf("Le contrat '%s' n'a pas été trouvé", $this->vrac_numero));
        }

        return $vrac;
    }

    public function getProduitConfig() {

       return ConfigurationClient::getCurrent()->get($this->produit_hash);
    }
}
{'fraction_non_alphanumeric': 0.14294330518697226, 'fraction_numerical': 0.0048250904704463205, 'mean_word_length': 2.427685950413223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '1862727', 'n_tokens_mistral': 541, 'n_tokens_neox': 527, 'n_words': 110}