More elegant way to write these conditions?
<p>out of curiosity I'm wondering if there's a more elegant way to write the conditionals below? I can't see a shorter way of writing it but it feels pretty clunky, so any suggestions welcome! </p>

<pre><code>        // Check whether this page has any visuals
        if (count($this-&gt;page-&gt;pagevisuals-&gt;find_all()) &gt; 0)
        {
            // Ok to go ahead and assign
            $visual = $this-&gt;page-&gt;pagevisuals-&gt;find_all();
        }
        // If this is a sub page, parent page may have visuals we can use
        elseif (count($this-&gt;page-&gt;parent-&gt;pagevisuals-&gt;find_all()) &gt; 0)
        {
             $visual = $this-&gt;page-&gt;parent-&gt;pagevisuals-&gt;find_all();
        }
        // If two levels deep, grandparent page might have visuals
        elseif (count($this-&gt;page-&gt;parent-&gt;parent-&gt;pagevisuals-&gt;find_all()) &gt; 0)
        {
            $visual = $this-&gt;page-&gt;parent-&gt;parent-&gt;pagevisuals-&gt;find_all();
        }
</code></pre>
