title: Symfony2 & Doctrine - Lazy load an entity's property through a service
body: <p>I'm wondering whether it's possible to make a custom Doctrine proxy or similar which would allow me to lazy load an Entity's property from a service.</p>
  
  <p>EXAMPLE:</p>
  
  <pre><code>class Article {
    ...
    /** @ORM\Column(type=integer) **/
    protected $userId;
  
    /** @var /MyUser  **/
    protected $user;
  }
  </code></pre>
  
  <p>$user property is not handled by doctrine. Users are fetched through a DI service which connects to a web service. What I would like to do is hook into doctrine so when <code>$article-&gt;user</code> is used the object is lazy loaded using the custom defined DI service.</p>
  
  <p>Any idea whether that is possible?</p>
  
  <p>If lazy loading is not possible, would it be possible to hook into the postLoad event and load the user object using the predefined service?</p>