title: CakePHP 3.x - Associations Error- unable Linking Tables Together
body: <p>i'm trying to Associate 2 tables:<code>Jobes</code> and <code>Types</code>. the table structure of types is very simple and includes only <code>id</code> and <code>name</code> ( 1.full-time 2.partial 3.freelance)</p>
  
  <p>Jobs table, in addition to all other fields contains also the foreign key of Types named:<code>type_id</code> so Jobs  <strong>belongsTo</strong> Types.
  i follow the Cake convention but still the same error:</p>
  
  <blockquote>
    <p>Jobs is not associated with Types...</p>
  </blockquote>
  
  <p>i'v created JobsTable class 
      
  
  <pre><code>use Cake\ORM\Table;
  class JobsTable extends Table{
  
      public $name= 'Jobs';
  
      public function initialize(array $config){
          $this-&gt;belongsTo('Types');                            
      }
  }
  </code></pre>
  
  <p>declare it in the controller:</p>
  
  <pre><code> &lt;?php
  
      namespace App\Controller;
  
      use App\Controller\AppController;
  
      class JobsController extends AppController
  
  {
  
          public $name='Jobs';
  
          public function index(){
              //Get job info
          $jobs =$this-&gt;Jobs-&gt;find('all')-&gt;contain(['Types']);
          $this-&gt;set('jobs',$jobs);
  
          }
      }
  </code></pre>
  
  <p>and then past it to view (index.ctp):</p>
  
  <pre><code>&lt;?php foreach ($jobs as $job) : ?&gt;
  
      &lt;p&gt; &lt;?php echo $job-&gt;title; ?&gt; &lt;?php echo $job-&gt;types-&gt;name; ?&gt;&lt;/p&gt;
  
   &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>Where is my mistake?</p>