title: CakePHP 3.0.0 cascade dependent deletes
body: <p>If I have the following in some model tables; As, Bs, Cs and Ds.</p>
  
  <p>They have these associations defined:</p>
  
  <p><strong>AsTable</strong>:</p>
  
  <pre><code>$this-&gt;hasOne('Bs', [
    'dependent' =&gt; true,
    'cascadeCallbacks' =&gt; true,
  ]);
  </code></pre>
  
  <p><strong>BsTable:</strong></p>
  
  <pre><code>$this-&gt;belongsTo('As', [
    'foreignKey' =&gt; 'A_id',
  ]);
  $this-&gt;hasMany('Cs', [
    'foreignKey' =&gt; 'B_id',
    'dependent' =&gt; true,
    'cascadeCallbacks' =&gt; true,
  ]);
  </code></pre>
  
  <p><strong>CsTable:</strong></p>
  
  <pre><code>$this-&gt;belongsTo('Bs', [
    'foreignKey' =&gt; 'B_id',
  ]);
  $this-&gt;hasMany('Ds', [
    'foreignKey' =&gt; 'C_id',
    'dependent' =&gt; true,
    'cascadeCallbacks' =&gt; true,
  ]);
  </code></pre>
  
  <p><strong>DsTable:</strong></p>
  
  <pre><code>$this-&gt;belongsTo('Cs', [
    'foreignKey' =&gt; 'C_id',
  ]);
  </code></pre>
  
  <p>Deleting an A now deletes the A, the B and any linked Cs but the Ds remain.</p>
  
  <p>Deleting a C causes linked Ds to be deleted.</p>
  
  <p>Why doesn't deleting an A also delete Ds linked to the Cs which are deleted?</p>
  
  <p>How can I make it so it does?</p>
  
  <p>EDIT:
  Cake exact version 3.0.0</p>
  
  <p>Looking at the SQL in the debugkit sql log it seems that the sequence is wrong to me.</p>
  
  <pre><code>select from Bs where A_id = a_id (finds record with id "b_id")
  delete from Cs where B_id = b_id 
  select from Cs where B_id = b_id 
  delete from Bs where id = b_id 
  delete from A where id = a_id
  </code></pre>
  
  <p>(replaced table names and ids for readability)</p>
  
  <p>Never touches D at all and obviously since it deletes from Cs before selecting it's never going to get the id(s) to be able to find anything in D.</p>
  
  <p>Mightily confused!</p>