title: What's the best practice for connecting information of two entities?
body: <p>It's a bit difficult for me to put my questions in words, but I'll try.</p>
  
  <p>I have two entities. One is called Product the other Sale. Each product has field definining the number of available items of this product. Each sale has a field stating the number of sold items of one product. Product to Sale is a OneToMany-Relationship.</p>
  
  <p>Now if I want to find out if a product has sold out, I need to create a function which substracts the total number of sold items from the initial availability number of the product. Something like <code>function getAvailableQuantity()</code>.</p>
  
  <p>My question is: Where do I place this method?
  I am tempted to put it in the Product Repository - but since this method needs to access the Sales entity this is against Dependency Injection. However, placing it in the controller seems like an unnecessary detour as I am losing the possibility of calling <code>{{ product.getAvailableQuantity }}</code> in Twig templates.</p>
  
  <p>What is the way to go?</p>
  
  <p>Thanks for any help!</p>