title: CakePHP3: how to pass parameter to join()?
body: <p>I have a <code>DefaultPermissions</code> table, so with a  <code>default permissions</code> set, and I want to compare this set with a <code>permissions</code> set affected to a specific site to see if additionnal default permissions exist.</p>
  
  <p>So I wrote the following query:</p>
  
  <pre><code>$defaultPermissions = $this-&gt;DefaultPermissions
  -&gt;find()
  -&gt;select([
      'user_id' =&gt; $selUser-&gt;id,
      'role',
      'sequence',
      'product',
      'module',
      'item',
      'value',
      'visible',
      'editable'
  ])
  -&gt;join([
      'p' =&gt; [
          'table' =&gt; 'permissions',
          'type' =&gt; 'LEFT',
          'conditions' =&gt; [
              'p.product = DefaultPermissions.product',
              'p.module = DefaultPermissions.module',
              'p.item = DefaultPermissions.item',
              'p.site_id' =&gt; $selSite-&gt;id   // My problem is here!
          ]
      ]
  ],
  [
      'p.product' =&gt; 'varchar', 
      'p.module' =&gt; 'varchar', 
      'p.item' =&gt; 'varchar',
      'p.site_id' =&gt; 'integer'
  ])
  -&gt;where([
      'DefaultPermissions.role' =&gt; $selUser-&gt;role,
      'p.item IS' =&gt; NULL, // item doit toujours être présent donc si null, la ligne est absente.
      'OR' =&gt; [['DefaultPermissions.product' =&gt; $agplan-&gt;product-&gt;code], ['DefaultPermissions.product' =&gt; '']]
  ])
  -&gt;all();
  </code></pre>
  
  <p>But despite all <code>defaultPermissions</code> can be found for site<code>selSite-&gt;id</code>, the query gives the complete list existing in <code>DefaultPermissions</code> table.
  If I remove the line <code>'p.site_id' =&gt; $selSite-&gt;id</code> the list is empty as expected so I conclude that the passed parameter is not well interpreted.</p>
  
  <p>How to do it?</p>