title: Symfony 3.2 Doctrine2 ORM storage of complex queries in the form of classes
body: <p>Kind time of the day, connoisseurs Symfony Already the third day I study Symfony 3.2 I learned to access several databases and tried a little Doctrine 2</p>
  
  <p>Everything worked out. Prompt please where to me to store a library of requests to a database that I did not have to use repeated requests in various controllers.</p>
  
  <p>If I do not understand explain</p>
  
  <p>There is a controller for example this <code>src / ParserBundle / EmployeesController.php</code></p>
  
  <p>There is a:</p>
  
  <pre><code>$Repository = $this-&gt;getDoctrine()-&gt;getRepository('ParserBundle:Provider');
  $Providers = $repository-&gt;findAll();
  </code></pre>
  
  <p>There is a class on queries to the database for example this <code>src / ParserBundle / Entity / Provider.php</code></p>
  
  <p>Then how to make complex queries I can read from the Doctrine 2 documentation, but where can I store them that would not duplicate? And how to access them from the main controllers - is there documentation about this?</p>