Jump to content

[RESOLU]Mais où se trouve cet insert into??


jherbaux

Recommended Posts

oui mais quand je modifie ce fichier ça ne marche pas:
par exemple si je veux rajouter un champ region j'ai d'autre modification a faire que sa?
sachant que je dois récupérer le champ dans le formulaire d'inscription


    public        $years;
   public        $days;
   public        $months;

   protected $tables = array ('customer');

    protected     $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email');
    protected     $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'email' => 128 );
    protected     $fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isName', 'firstname' => 'isName', 'email' => 'isEmail', 'passwd' => 'isPasswd',
        'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool', 'region' => 'isRegion');

   protected     $table = 'customer';
   protected     $identifier = 'id_customer';

   public function getFields()
   {
       parent::validateFields();
       if (isset($this->id))
           $fields['id_customer'] = intval($this->id);
       $fields['secure_key'] = pSQL($this->secure_key);
       $fields['id_gender'] = intval($this->id_gender);
       $fields['lastname'] = pSQL(Tools::strtoupper($this->lastname));
       $fields['firstname'] = pSQL($this->firstname);
       $fields['birthday'] = pSQL($this->birthday);
       $fields['email'] = pSQL($this->email);
       $fields['newsletter'] = intval($this->newsletter);
       $fields['newsletter_date_add'] = pSQL($this->newsletter_date_add);
       $fields['ip_registration_newsletter'] = pSQL($this->ip_registration_newsletter);
       $fields['optin'] = intval($this->optin);
       $fields['passwd'] = pSQL($this->passwd);
       $fields['last_passwd_gen'] = pSQL($this->last_passwd_gen);
       $fields['active'] = intval($this->active);
       $fields['date_add'] = pSQL($this->date_add);
       $fields['date_upd'] = pSQL($this->date_upd);
       $fields['deleted'] = intval($this->deleted);
       $fields['region'] = intval($this->region);
       return $fields;
   }

Link to comment
Share on other sites

Bein dans Customer.php :

/** @var boolean region subscription */
public         $region=1;

...

   public function getFields()
   {
       parent::validateFields();
       if (isset($this->id))
           $fields['id_customer'] = intval($this->id);

....

       $fields['region'] = intval($this->region);
       return $fields;
   }



et le champ qui va bien dans la table ps_customer et çà roule.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...