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

class DRMESDetailAlcoolPur extends BaseDRMESDetailAlcoolPur {

    public function getDetail() {

        return $this->getParent()->getProduitDetail();
    }

    public function getProduitDetail() {

        return $this->getParent()->getProduitDetail();
    }

    public function getIdentifiantLibelle() {

        return "";
    }

    public function getKey() {
        if (parent::getKey()) {
            return parent::getKey();
        }
        return $this->getTheoriticalKey();
    }

    public function setProduit($p) {
        $this->identifiant = $p->getHash();
    }

    public function getProduit() {
        if (!$this->identifiant) {
            throw new sfException('set produit first');
        }
        return $this->getDocument()->get($this->identifiant);
    }

    private function getTheoriticalKey() {
        if (!$this->identifiant) {
            if(!$this->getDocument()->_id) {
                throw new sfException("DRM id must be set");
            }
            $this->identifiant = $this->getDocument()->_id."-".uniqid();
        }
        return str_replace('/', '-', $this->identifiant);
    }

    private function updateVolume() {
        $p = $this->getProduit();
        if($this->getTav() !== 0.0 ){
          $p->entrees->add('transfertsrecolte', $this->volume * 100 / $this->getTav());
        }
    }

    public function setVolume($volume) {
        $r = $this->_set('volume', $volume);
        $this->updateVolume();

        return $r;
    }

    public function setTav($tav) {
        $p = $this->getProduit();
        $r = $p->add('tav', $tav);
        $this->updateVolume();

        return $r;
    }

    public function getTav() {
        $p = $this->getProduit();
        return $p->tav;<commit_msg>Fix oups onglet matière première ajout produit<commit_after><?php
/**
 * Model for DRMESDetailExport
 *
 */

class DRMESDetailAlcoolPur extends BaseDRMESDetailAlcoolPur {

    public function getDetail() {

        return $this->getParent()->getProduitDetail();
    }

    public function getProduitDetail() {

        return $this->getParent()->getProduitDetail();
    }

    public function getIdentifiantLibelle() {

        return "";
    }

    public function getKey() {
        if (parent::getKey()) {
            return parent::getKey();
        }
        return $this->getTheoriticalKey();
    }

    public function setProduit($p) {
        $this->identifiant = $p->getHash();
    }

    public function getProduit() {
        if (!$this->identifiant) {
            throw new sfException('set produit first');
        }
        return $this->getDocument()->get($this->identifiant);
    }

    private function getTheoriticalKey() {
        if (!$this->identifiant) {
            if(!$this->getDocument()->_id) {
                throw new sfException("DRM id must be set");
            }
            $this->identifiant = $this->getDocument()->_id."-".uniqid();
        }
        return str_replace('/', '-', $this->identifiant);
    }

    private function updateVolume() {
        $p = $this->getProduit();
        if($this->getTav() !== 0.0 && $this->getTav() !== null){
          $p->entrees->add('transfertsrecolte', $this->volume * 100 / $this->getTav());
        }
    }

    public function setVolume($volume) {
        $r = $this->_set('volume', $volume);
        $this->updateVolume();

        return $r;
    }

    public function setTav($tav) {
        $p = $this->getProduit();
        $r = $p->add('tav', $tav);
        $this->updateVolume();

        return $r;
    }

    public function getTav() {
        $p = $this->getProduit();
        return $p->tav;
{'fraction_non_alphanumeric': 0.16315505132360886, 'fraction_numerical': 0.002701242571582928, 'mean_word_length': 2.156862745098039, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, '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': '6101198', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1130, 'n_words': 215}