<commit_before><?php

class EtablissementClient extends acCouchdbClient {
    
    const TYPE_MODEL = "Etablissement"; 
    const TYPE_COUCHDB = "ETABLISSEMENT";

    const FAMILLE_VINIFICATEUR = "VINIFICATEUR";
    const FAMILLE_PRODUCTEUR = "PRODUCTEUR";
    const FAMILLE_DISTILLATEUR = "DISTILLATEUR";
    const FAMILLE_ELABORATEUR = "ELABORATEUR";
    const FAMILLE_CONDITIONNEUR = "CONDITIONNEUR";
    const FAMILLE_METTEUR_EN_MARCHE = "METTEUR_EN_MARCHE";
    const FAMILLE_NEGOCIANT = "NEGOCIANT";
    const FAMILLE_CAVE_COOPERATIVE = "CAVE_COOPERATIVE";

    public static function getInstance()
    {
        return acCouchdbManager::getClient(self::TYPE_MODEL);
    }

    public function find($id, $hydrate = self::HYDRATE_DOCUMENT, $force_return_ls = false) {
        $doc = parent::find($id, $hydrate, $force_return_ls);

        if($doc && $doc->type != self::TYPE_MODEL) {

            throw new sfException("Document \"%s\" is not type of \"%s\"", $id, self::TYPE_MODEL);
        }

        return $doc;
    }

    public function getAll($hydrate = self::HYDRATE_DOCUMENT) {

        $query = $this->startkey(sprintf("ETABLISSEMENT-%s", "0000000000"))
                    ->endkey(sprintf("ETABLISSEMENT-%s", "9999999999"));
        
        return $query->execute(acCouchdbClient::HYDRATE_ARRAY);
    }

    public function findByIdentifiant($identifiant) {

        return $this->find('ETABLISSEMENT-'.$identifiant);
    }

    public function createOrFind($identifiant) {<commit_msg>Format de date de la premiere connexion<commit_after><?php

class EtablissementClient extends acCouchdbClient {
    
    const TYPE_MODEL = "Etablissement"; 
    const TYPE_COUCHDB = "ETABLISSEMENT";

    const FAMILLE_VINIFICATEUR = "VINIFICATEUR";
    const FAMILLE_PRODUCTEUR = "PRODUCTEUR";
    const FAMILLE_DISTILLATEUR = "DISTILLATEUR";
    const FAMILLE_ELABORATEUR = "ELABORATEUR";
    const FAMILLE_CONDITIONNEUR = "CONDITIONNEUR";
    const FAMILLE_METTEUR_EN_MARCHE = "METTEUR_EN_MARCHE";
    const FAMILLE_NEGOCIANT = "NEGOCIANT";
    const FAMILLE_CAVE_COOPERATIVE = "CAVE_COOPERATIVE";

    const STATUT_INSCRIT = 'INSCRIT';

    public static function getInstance()
    {
        return acCouchdbManager::getClient(self::TYPE_MODEL);
    }

    public function find($id, $hydrate = self::HYDRATE_DOCUMENT, $force_return_ls = false) {
        $doc = parent::find($id, $hydrate, $force_return_ls);

        if($doc && $doc->type != self::TYPE_MODEL) {

            throw new sfException("Document \"%s\" is not type of \"%s\"", $id, self::TYPE_MODEL);
        }

        return $doc;
    }

    public function getAll($hydrate = self::HYDRATE_DOCUMENT) {

        $query = $this->startkey(sprintf("ETABLISSEMENT-%s", "0000000000"))
                    ->endkey(sprintf("ETABLISSEMENT-%s", "9999999999"));
        
        return $query->execute(acCouchdbClient::HYDRATE_ARRAY);
    }

    public function findByIdentifiant($identifiant) {

        return $this->find('ETABLISSEMENT-'.$identifiant);
    }

    public function createOrFind($identifiant) {
{'fraction_non_alphanumeric': 0.12113318137414524, 'fraction_numerical': 0.013025073266037121, 'mean_word_length': 3.5309734513274336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '5456295', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1061, 'n_words': 183}