<commit_before><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of class AddRowRevendicationForm
 * @author mathurin
 */
class AddRowRevendicationForm extends EditionRevendicationForm {

    protected $revendication;

    public function __construct(stdClass $revendication, $defaults = array(), $options = array(), $CSRFSecret = null) {
        $this->revendication = $revendication;
        parent::__construct($revendication, null, null, $defaults, $options, $CSRFSecret);
    }

    public function configure() {
        parent::configure();
        $this->setWidget('etablissement', new WidgetEtablissement(array('interpro_id' => 'INTERPRO-inter-loire', 'familles' => array(EtablissementFamilles::FAMILLE_NEGOCIANT, EtablissementFamilles::FAMILLE_PRODUCTEUR))));
        $this->setValidator('etablissement', new ValidatorEtablissement(array('required' => true)));
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
        $this->widgetSchema->setNameFormat('revendication_creation_row[%s]');
    }

    public function doUpdate() {

        return RevendicationClient::getInstance()->addVolumeSaisiByStdClass($this->revendication,
                                                                            $this->values['etablissement'],
                                                                            $this->values['produit_hash'],
                                                                            $this->values['volume'],
                                                                            date('Y-m-d'));
    }<commit_msg>ajout des coopératives dans le widget d'ajout de ligne des VR<commit_after><?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of class AddRowRevendicationForm
 * @author mathurin
 */
class AddRowRevendicationForm extends EditionRevendicationForm {

    protected $revendication;

    public function __construct(stdClass $revendication, $defaults = array(), $options = array(), $CSRFSecret = null) {
        $this->revendication = $revendication;
        parent::__construct($revendication, null, null, $defaults, $options, $CSRFSecret);
    }

    public function configure() {
        parent::configure();
        $this->setWidget('etablissement', new WidgetEtablissement(array('interpro_id' => 'INTERPRO-inter-loire', 'familles' => array(EtablissementFamilles::FAMILLE_NEGOCIANT, EtablissementFamilles::FAMILLE_PRODUCTEUR, EtablissementFamilles::FAMILLE_COOPERATIVE))));
        $this->setValidator('etablissement', new ValidatorEtablissement(array('required' => true)));
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
        $this->widgetSchema->setNameFormat('revendication_creation_row[%s]');
    }

    public function doUpdate() {

        return RevendicationClient::getInstance()->addVolumeSaisiByStdClass($this->revendication,
                                                                            $this->values['etablissement'],
                                                                            $this->values['produit_hash'],
                                                                            $this->values['volume'],
                                                                            date('Y-m-d'));
    }
{'fraction_non_alphanumeric': 0.11305361305361306, 'fraction_numerical': 0.0, 'mean_word_length': 2.226503759398496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3754842', 'n_tokens_mistral': 845, 'n_tokens_neox': 843, 'n_words': 157}