title: CakePHP 2 How to find last record with hasn't related model empty
body: <p>I use <code>find('first')</code> with order by <code>created</code> field for return last record from table.</p>
  
  <p>But I would like return last record if his related model isn't empty.</p>
  
  <p>It is possible?</p>
  
  <p><strong>Edit:</strong><br>
  I add code, but doesn't work:</p>
  
  <pre><code>$last_project = $this-&gt;Project-&gt;find('first', array(
      'conditions' =&gt; array(
          'COUNT(ProjectPhoto.id) &gt;' =&gt; 0),
      'joins' =&gt; array(
          array(
              'table' =&gt; 'project_photos',
              'alias' =&gt; 'ProjectPhoto',
              'type' =&gt; 'INNER',
              'conditions' =&gt; array(
                  'Project.id = ProjectPhoto.project_id'))),
      'order' =&gt; 'Project.created DESC'));
  </code></pre>