title: Doctrine OneToMany relation does not fetch related entities
body: <p>I am stuck at this case, I reproduced it in an example from symfony documentation, here it how it looks:</p>
  
  <p><strong>FIXTURES</strong></p>
  
  <pre><code>/**
   * @ORM\Entity
   */
  class Category
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue
       */
      private $id;
      /**
       * @ORM\OneToMany(targetEntity="Product", mappedBy="category", fetch="EAGER")
       */
      private $products;
  
      public function __construct()
      {
          $this-&gt;products = new ArrayCollection();
      }
  
      public function products(): Collection
      {
          return $this-&gt;products;
      }
  
      public function id()
      {
          return $this-&gt;id;
      }
  }
  </code></pre>
  
  <p>and related Product class</p>
  
  <pre><code>/**
   * @ORM\Entity
   */
  class Product
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue
       */
      protected $id;
  
      /**
       * @ORM\ManyToOne(targetEntity="Category", inversedBy="products")
       * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
       */
      private $category;
  
      public function __construct($category)
      {
          $this-&gt;category = $category;
      }
  
      public function id()
      {
          return $this-&gt;id;
      }
  
      public function category()
      {
          return $this-&gt;category;
      }
  }
  </code></pre>
  
  <p><strong>TEST</strong></p>
  
  <p>Now I have this snippet of test code where I want to fetch Category and be able to get its Products:</p>
  
  <pre><code>$cat = new Category();
  $prod = new Product($cat);
  
  $this-&gt;entityManager-&gt;persist($prod);
  $this-&gt;entityManager-&gt;persist($cat);
  $this-&gt;entityManager-&gt;flush();
  
  $crepo = $this-&gt;getEntityManager()-&gt;getRepository(Category::class);
  $c = $crepo-&gt;findAll()[0];
  
  var_dump(get_class($c-&gt;products()), $c-&gt;products()-&gt;count())
  </code></pre>
  
  <p>What I am getting is products of class <code>PersistentCollection</code> which is expected, but the count is 0 while there should be 1 product.</p>
  
  <p>I can see that in the database I have proper category and product records with proper foreign key set.</p>
  
  <p><strong>WORKAROUND</strong></p>
  
  <p>I am debugging <code>PersistentCollection</code> for products and can see that its flag is set to initialized = true. With this I am able to force this to work by calling</p>
  
  <pre><code>$c-&gt;products()-&gt;setInitialized(false);
  $c-&gt;products()-&gt;initialize();
  </code></pre>
  
  <p>But afaik this is not how it should work, should it ?</p>