title: How to retrieve Aggregate objects?
body: <p>In DDD, Repository takes care of saving and retrieving domain objects and also serves as collection of Aggregate Roots. My question is how do you retrieve the information for those child entities (let's say from DB) of an Aggregate where basic rule is Repository should just hold collection of Aggregate Roots (parent object) and not child objects?</p>
  
  <p>For example:</p>
  
  <p>User (parent object)
  Orders (child object)</p>
  
  <p>User domain object is stored in user table and Orders are stored in another table.</p>
  
  <p>Basically, retrieving a Domain Object could be like this:</p>
  
  <pre><code>&lt;?php
  $userRepos = new UserRepository();
  $user = $userRepos-&gt;find($userId);
  ?&gt;
  </code></pre>
  
  <p>How then the child object (Orders) of User entity be retrieve to be as part of the User aggregate?</p>