title: Cakephp get childrens associated data
body: <ul>
  <li><p>I have a product that has a brand. A brand_id in product table.</p></li>
  <li><p>A brand has a collection of images.</p></li>
  <li><p>Images have the id, product_id and path in the table.</p></li>
  </ul>
  
  <p>When in the product index, you get the entity that has the associated brands data from like below. You can't go any deeper to what i want than this:</p>
  
  <pre><code>    $product-&gt;brands[0]['image_id'];
  </code></pre>
  
  <p>To get the path, I want to be able to go something like:</p>
  
  <pre><code>    $product-&gt;brand-&gt;image['path'];
  </code></pre>
  
  <p>Currently the product index gets its stuff like this:</p>
  
  <pre><code>$this-&gt;paginate = [
          'contain' =&gt; ['Brands']
      ];
      $products = $this-&gt;paginate($this-&gt;Products);
  
      $this-&gt;set(compact('products'));
      $this-&gt;set('_serialize', ['products']);
  </code></pre>
  
  <p>So how do i approach a 'subquery' or something to also get the image table data (secondary association of product, through brands)</p>
  
  <p>How do I go about this?</p>