title: Doctrine get all entities from collection
body: <p>I don't know if what I am trying is really possible. So I thought to ask it to you guys.</p>
  
  <p>What I am trying to do:</p>
  
  <ul>
  <li>get a set of companies</li>
  <li>get all the users associated with the given companies</li>
  </ul>
  
  <p>In code:</p>
  
  <pre><code>$companyIds = array(1,2,3);
  $companies = $this-&gt;em-&gt;getRepository('AppBundle:Company')-&gt;findById($companyIds);
  dump($companies-&gt;getUsers()); // this will not work, but I like it to work
  </code></pre>
  
  <p>Where they are associated as follows:</p>
  
  <pre><code>class User implements AdvancedUserInterface, \Serializable
  {
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Company", inversedBy="users")
     * @ORM\JoinColumn(name="company_id", referencedColumnName="id", nullable=false)
     */
    private $company;
  }
  
  class Company
  {
      /**
       * @ORM\OneToMany(targetEntity="AppBundle\Entity\User", mappedBy="company")
       */
      private $users;
  }
  </code></pre>