title: How to detect if entity exist in database
body: <p>I have 2 entities, User and Profile. Profile has in-symfony relation with User, but there is no in-database relation (no foreign key, no cascade) - only simple int column named user_id and nothing more.</p>
  
  <p>Problem is obvious: when i delete user - associated profiles persists, but their user_id points to non-existing user row.</p>
  
  <p>Since I use in-symfony relations when i fetch profile from database it fetches also related user entity. I expected that if there is no row with specific ID, it would just leave null or at least throw an exception or something.</p>
  
  <p>Problem is that symfony creates empty User entity object with only id set. rest of its fields are null.</p>
  
  <p>I know solution would be to create FK, constraints etc ... but I'm not allowed to touch anything in database schema.</p>
  
  <p>How can I manage this problem ? I could even leave those empty object if only i had simple way to determine if they exist in database inside TWIG - so i would know if i can display {{ profile.user.email }} for example.</p>