<commit_before><?php

class DRRecolteLieuAcheteur extends BaseDRRecolteLieuAcheteur
{
  private $acheteur = null;

  public function getLieu() {
      return $this->getParent()->getParent()->getParent();
  }

  public function getVolume() {
    return $this->getLieu()->getVolumeAcheteur($this->getKey(), $this->type_acheteur);
  }
  public function getNom() {
    if ($v = $this->_get('nom'))
      return $v;
    $v = $this->getAcheteurFromCVI()->getNom();
    $this->nom = $v;
    return $v;
  }
  public function getCommune() {
    if ($v = $this->_get('commune'))
      return $v;
    $v = $this->getAcheteurFromCVI()->getCommune();
    $this->commune = $v;
    return $v;
  }
  public function getCVI() {
    return $this->getKey();
  }
  private function getAcheteurFromCVI() {
    if (!$this->acheteur) {
      $this->acheteur = EtablissementClient::getInstance()->findByCvi($this->getKey());
    }
    if (!$this->acheteur) {
        $this->acheteur = new Etablissement();
    }
    return $this->acheteur;
  }

  protected function update($params = array()) {
    parent::update($params);
    $this->getNom();
    $this->getCommune();
    $this->synchronizeRecolteAcheteur();
  }

  protected function synchronizeRecolteAcheteur() {
        $appellation_key = $this->getLieu()->getAppellation()->getKey();
        if($this->getLieu()->getMention()->getKey() != "mention") {
            $appellation_key = $this->getLieu()->getMention()->getKey();
        }
        $this->getDocument()->add('acheteurs')->addAppellationTypeCVI($appellation_key, $this->type_acheteur, $this->getCVI());
  }
}
<commit_msg>Correction d'un bug à l'import de VT uniquement<commit_after><?php

class DRRecolteLieuAcheteur extends BaseDRRecolteLieuAcheteur
{
  private $acheteur = null;

  public function getLieu() {
      return $this->getParent()->getParent()->getParent();
  }

  public function getVolume() {
    return $this->getLieu()->getVolumeAcheteur($this->getKey(), $this->type_acheteur);
  }
  public function getNom() {
    if ($v = $this->_get('nom'))
      return $v;
    $v = $this->getAcheteurFromCVI()->getNom();
    $this->nom = $v;
    return $v;
  }
  public function getCommune() {
    if ($v = $this->_get('commune'))
      return $v;
    $v = $this->getAcheteurFromCVI()->getCommune();
    $this->commune = $v;
    return $v;
  }
  public function getCVI() {
    return $this->getKey();
  }
  private function getAcheteurFromCVI() {
    if (!$this->acheteur) {
      $this->acheteur = EtablissementClient::getInstance()->findByCvi($this->getKey());
    }
    if (!$this->acheteur) {
        $this->acheteur = new Etablissement();
    }
    return $this->acheteur;
  }

  protected function update($params = array()) {
    parent::update($params);
    $this->getNom();
    $this->getCommune();
    $this->synchronizeRecolteAcheteur();
  }

  protected function synchronizeRecolteAcheteur() {
        if($this->getLieu()->getMention()->getKey() != "mention") {
            $this->getDocument()->add('acheteurs')->addAppellationTypeCVI($this->getLieu()->getMention()->getKey(), $this->type_acheteur, $this->getCVI());
        }

        $this->getDocument()->add('acheteurs')->addAppellationTypeCVI($this->getLieu()->getAppellation()->getKey(), $this->type_acheteur, $this->getCVI());

  }
}

{'fraction_non_alphanumeric': 0.18818181818181817, 'fraction_numerical': 0.0, 'mean_word_length': 3.6362359550561796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 88, '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': '2767084', 'n_tokens_mistral': 1151, 'n_tokens_neox': 1147, 'n_words': 178}