title: Dynamically extend User entity in symfony
body: <p>I have the following scenario:</p>
  
  <ul>
  <li>My project has an <code>AppBundle</code> with a <code>User</code> entity.</li>
  <li>Other bundles add more entities like <code>Address</code>, <code>Todo</code>, <code>Project</code>, <code>WhatEver</code>.</li>
  <li>Those entities must belong to a <code>User</code> so that I can call <code>$user-&gt;getAddresses()</code>, <code>$user-&gt;getTodos()</code>, <code>$user-&gt;addProject()</code>, <code>$user-&gt;setWhatEvers()</code>.</li>
  <li>Those bundles must remain "pluggable" so the <code>User</code> entity doesn't necessarily know about them and I can't add those properties like <code>todos</code> and its getters/setters directly into the <code>User</code> entity.</li>
  </ul>
  
  <p>I thought about reflection, magic getters/setters, traits as possible aproaches but nothing really fits my needs.</p>
  
  <p>I also considered <em>generating</em> the <code>User</code> entity but this would mean I have to regenerate it everytime I enable or disable a bundle and the database also has to be updated each time.</p>
  
  <p>Maybe there is a completly different aproach?</p>