Returning null to object call
<p>I have written an auth class that allows the following:</p>

<pre><code>echo $auth-&gt;user()-&gt;username;
</code></pre>

<p>Which will return the users username if they are logged in, but querying the database and fetching an object.</p>

<p>The problem is, when no user is logged in, the auth class won't be able to find any row meaning that there will be nothing to return. When I log out, the code breaks and I get</p>

<blockquote>
  <p>Notice: Trying to get property of non-object in /example/ on line 105</p>
</blockquote>

<p>So could I go about this some way so that if no user is logged in, it will return null or an empty string?</p>
