title: How to retrieve an entity with all of its associations using EntityManager in Doctrine2?
body: <p>I have a simple entity with many-to-many and one-to-many associations. I'm aware of 'Joins' for fetching related associations which is a manual solution for my problem.</p>
  
  <p>How can I fetch an entity with all of its associations using EntityManager in Doctrine2? e.g.:</p>
  
  <pre class="lang-php prettyprint-override"><code>$this-&gt;em
       -&gt;getRepository('Entities\Patientprofile')
       -&gt;findOneByuserid('555555557')
       -&gt;fetchAllAssociations();
  </code></pre>