title: How to get following values
body: <p>I am doing projec using mongodb with ODM tool. so here I try to use find query. this is my code</p>
  
  <pre><code>$dm    = $this-&gt;getServiceLocator()-&gt;get('doctrine.documentmanager.odm_default');
  $user = $dm-&gt;getRepository('Application\Document\User')-&gt;findOneBy(array('username' =&gt; 'admin'));
  </code></pre>
  
  <p>so now $user variable contain some values related to find query. so when I use <code>var_dump($user)</code> it show following result </p>
  
  <blockquote>
    <p>object(Application\Document\User)#253 (4) { ["id":"Application\Document\User":private]=> string(24) "5103d0aca00b2a3205000001" ["username":"Application\Document\User":private]=> string(5) "admin" ["email":"Application\Document\User":private]=> string(15) "admin@xmail.com" ["password":"Application\Document\User":private]=> string(3) "abc" }</p>
  </blockquote>
  
  <p>so please tell me how to get <code>username</code> value from the <code>$user</code> object`.</p>