title: Adding addCondition() in a Form with fields from other tables
body: <p>I don't know the syntax to access "CurrentTable.ForeignKey" nor "OtherTable.PrimaryKey" in a $model->addCondition() statement.</p>
  
  <p>This is a fragment of my code which works:<code>
      $mm = new SYSPC_MODEL($this-&gt;app-&gt;db,['title_field'=&gt;'MODEL_NAME']);
      $mm-&gt;addCondition('MODEL_NAME', 'LIKE', 'DESK%');</code></p>
  
  <p>In place of simply searching for MODEL_NAME like 'DESK%', I would like to display only the FK_MODEL_id values which exist in the SYSPC_MODEL table for the same FK_OS_ID than the current record FK_OS_ID value. So in SQL, we should have something like:<code>
    SELECT SYSPC_MODEL.MODEL_NAME WHERE ( DHCP_PC.FK_OS_ID = SYSPC_MODEL.id )</code></p>
  
  <p>To understand easier the context, I reduced my code as much as possible:</p>
  
  <pre><code>&lt;?php
  include_once ('../include/config.php');
  require '../vendor/autoload.php';
  
  class SYSPC_OS  extends \atk4\data\Model {
      public $table = 'SYSPC_OS';
      function init() {
          parent::init();
          $this-&gt;addFields([ ['OS_NAME',         'required'=&gt;true, 'caption'=&gt;'Identifiant d\'OS'],
                              ['OS_DESCRIPTION', 'required'=&gt;true, 'caption'=&gt;'Description d\'OS']
                          ]);
      }
  }     // End of class SYSPC_OS
  
  class SYSPC_MODEL  extends \atk4\data\Model {
      public $table = 'SYSPC_MODEL';
      function init() {
          parent::init();
          $this-&gt;addFields([ ['MODEL_NAME',     'caption'=&gt;'Nom du modele'],
                              ['MODEL_BASE_RPM', 'caption'=&gt;'Rpm de base']
                          ]);
          $this-&gt;hasOne('FK_OS_id',[new SYSPC_OS(),'ui'=&gt;['visible'=&gt;false]])-&gt;addField('OS_NAME','OS_NAME');
      }
  }     // End of class SYSPC_MODEL
  
  class DHCP_PC  extends \atk4\data\Model {
      public $table = 'DHCP_PC';
      function init() {
          parent::init();
          $this-&gt;addFields([  ['PCNAME',      'required'=&gt;true, 'caption'=&gt;'Nom du pc']
                          ]);
          $this-&gt;hasOne('FK_OS_ID',['required'=&gt;true,new SYSPC_OS(),'ui'=&gt;['visible'=&gt;false]])-&gt;addField('OS_NAME','OS_NAME');
          $this-&gt;setOrder('PCNAME','asc');
          $this-&gt;hasOne('FK_MODEL_id',['required'=&gt;true,new SYSPC_MODEL(),'ui'=&gt;['visible'=&gt;false]])-&gt;addField('MODEL_NAME','MODEL_NAME');
      }
  }      // End of class DHCP_PC
  
  class PcForm extends \atk4\ui\Form {
      function setModel($m, $fields = null) {
          $PcWidth = 'three';
          parent::setModel($m, false);
          $gr = $this-&gt;addGroup('PC name');
          $gr-&gt;addField('PCNAME',['required'=&gt;true,'caption'=&gt;'Nom du pc']);
          $gr = $this-&gt;addGroup('OS');
          $mm2 = new SYSPC_OS($this-&gt;app-&gt;db,['title_field'=&gt;'OS_NAME']);
          $gr-&gt;addField('FK_OS_ID',['width'=&gt;$PcWidth],['DropDown'])-&gt;setModel($mm2);
  
          $gr = $this-&gt;addGroup('Modèle');
          $mm = new SYSPC_MODEL($this-&gt;app-&gt;db,['title_field'=&gt;'MODEL_NAME']);
          $mm-&gt;addCondition('MODEL_NAME', 'LIKE', 'DESK%');  // Works fine but I would like to display only the FK_MODEL_id values 
                                                              // which exist in the SYSPC_MODEL table for the same FK_OS_ID 
                                                              // than the current record FK_OS_ID value :
                                                              // SELECT SYSPC_MODEL.MODEL_NAME WHERE ( DHCP_PC.FK_OS_ID = SYSPC_MODEL.id )
          $gr-&gt;addField('FK_MODEL_id', ['width'=&gt;$PcWidth], ['DropDown'])-&gt;setModel($mm);
          return $this-&gt;model;
      }
  }     // End of class PcForm
  
  $app = new \atk4\ui\App();
  $app-&gt;title = 'Gestion des PC';
  $app-&gt;initLayout($app-&gt;stickyGET('layout') ?: 'Admin');
  $app-&gt;db = new \atk4\data\Persistence_SQL(
      "pgsql:host=".$GLOBALS['dbhost'].";dbname=".$GLOBALS['dbname'],
      $GLOBALS['dbuser'],
      $GLOBALS['dbpass']
  );
  $g = $app-&gt;add(['CRUD', 'formDefault'=&gt;new PcForm()]);
  $g-&gt;setIpp([10, 25, 50, 100]);
  $g-&gt;setModel(new DHCP_PC($app-&gt;db),['PCNAME', 'OS_NAME', 'MODEL_NAME']);
  ?&gt;
  </code></pre>