title: How can I use Prestashop registration form?
body: <p>I have added a field to my Prestashop registration form and I want to display and update it from the user interface. I already have a good part since the field appears, we can fill it and it is displayed in the database. The problem is that I am missing an essential part; the possibility to display it in the user interface and the update, can someone help me ? I have a get function and I think I need a set function too to be able to update, but I don't know what to write in it</p>
  <p>My module files</p>
  <pre><code>&lt;?php
  if (!defined('_PS_VERSION_')) {
      exit;
  }
  use PrestaShop\PrestaShop\Adapter\Presenter\Object\ObjectPresenter;
  
  require_once dirname(__FILE__) . '/classes/CustomerFonction.php';
  
  class AddJob extends Module
  {
      public function __construct()
      {
          $this-&gt;name = 'addjob';
          $this-&gt;tab = 'others';
          $this-&gt;version = '1.0.0';
          $this-&gt;author = 'advisa';
          $this-&gt;need_instance = 0;
          $this-&gt;ps_versions_compliancy = [
              'min' =&gt; '1.6',
              'max' =&gt; '1.7.99',
          ];
          $this-&gt;bootstrap = true;
  
          parent::__construct();
  
          $this-&gt;displayName = $this-&gt;l('AddJob');
          $this-&gt;description = $this-&gt;l('Add job in registration form');
      }
      public function install()
      {
          return parent::install() &amp;&amp;
              $this-&gt;installSql() &amp;&amp;
              $this-&gt;registerHook('additionalCustomerFormFields') &amp;&amp;
              $this-&gt;registerHook('actionCustomerAccountAdd');
  
      }
      public function uninstall()
      {
          return (
          parent::uninstall()
          );
      }
      /*
      public function installSql()
      {
          $sqlInstall = &quot;ALTER TABLE &quot; . _DB_PREFIX_ . &quot;customer &quot;
              . &quot;ADD fonction VARCHAR(255) NULL&quot;;
  
          return Db::getInstance()-&gt;execute($sqlInstall);
      } */
      public function installSql()
                  {
                      $sqlQuery = array();
                      $sqlQuery[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'addjob_addfonction` (
                          `id_addfonction` INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT,
                          `id_customer` INT(10),
                          `fonction` VARCHAR(255)
                      )';
  
                      $db = Db::getInstance();
                      foreach ($sqlQuery as $query) {
                          if (!$db-&gt;execute($query)) {
                              return false;
                          }
                      }
                      return true;
                  }
  
      public function hookAdditionalCustomerFormFields($param)
      {
          $field = array();
          $field['fonction'] = (new FormField())
                  -&gt;setName('fonction')
                  -&gt;setType('text')
                  //-&gt;setRequired(true)
                  -&gt;setLabel($this-&gt;l('Fonction'));
          if($this-&gt;context-&gt;customer-&gt;id !== null){
              $data = new CustomerFonction($this-&gt;context-&gt;customer-&gt;id);
              $field['fonction']-&gt;setValue($data-&gt;fonction ?? '');
          }
          return $field;
      }
  
      public function hookActionCustomerAccountAdd($param)
      {
          $customeField = new CustomerFonction();
          $customeField-&gt;id_customer = $param['newCustomer']-&gt;id;
          $customeField-&gt;fonction = Tools::getValue('fonction', '');
  
          $customeField-&gt;add();
  
      }
      public function hookActionCustomerAccountUpdate($param)
      {
          $customerId = $this-&gt;context-&gt;customer-&gt;id;
          $customerField = new CustomerFonction($customerId);
          $customerField-&gt;id_customer = $customerId;
          $customerField-&gt;fonction = Tools::getValue('fonction', '');
  
          $customerField-&gt;save();
      }
  }
  </code></pre>
  <p>And my ObjectModel classes</p>
  <pre><code>&lt;?php
  
  class CustomerFonction extends ObjectModel
  {
      public $id_addfonction;
      public $id_customer;
      public $fonction;
  
      public static $definition = [
          'table' =&gt; 'addjob_addfonction',
          'primary' =&gt; 'id_addfonction',
          'multilang' =&gt; false,
          'fields' =&gt; [
              'id_customer' =&gt; ['type' =&gt; self::TYPE_INT],
              'fonction' =&gt; ['type'=&gt;self::TYPE_STRING, 'size'=&gt; 255],
          ],
      ];
      public static function getFonctionByCustomer($id_customer): ?string
      {
          $sql = new DbQuery();
          $sql-&gt;select('fonction');
          $sql-&gt;from('addjob_fonction');
          $sql-&gt;where('id_customer = ' . $id_customer);
          return Db::getInstance()-&gt;getValue($sql);
      }
      public static function getByCustomerId(): self
      {
  
      }
      public static function setFonctionByCustomer(string $fonction, $id): self
      {
  
      }
  }
  </code></pre>