Linking two PHP objects together
<p>I have these two objects:</p>

<pre><code>$userinfo-&gt;pilotid;
$departures-&gt;total; 
</code></pre>

<p>I'm trying to get <code>$departures-&gt;total</code> for specific <code>pilotid</code> in <code>$userinfo</code> = <code>$userinfo-&gt;pilotid</code>.</p>

<p>However, I'm not sure how can I link them so it echoes A for B. I have something like this but it does not display anything.</p>

<pre><code>&lt;?php echo $pilotid-&gt;$departures-&gt;total; ?&gt;
</code></pre>

<p>Additionally, the first object is called like this:</p>

<pre><code>$pilotid = Auth::$userinfo-&gt;pilotid;
</code></pre>

<p>This is the structure of the table where the objects are gathered from, using a query.</p>

<p><img src="http://i.stack.imgur.com/cH1PP.jpg" alt="http://i.stack.imgur.com/ZaYVe.jpg"></p>
