title: Doctrine. Why i get persistentCollection and an empty array on ManyToMany?
body: <p>This is my Entity:</p>
  
  <pre><code>/**
  * Productgeneral
  * @ORM\Table(name="ProductGeneral", indexes={@ORM\Index(name="category_id", columns={"category_id"})})
  * @ORM\Entity
  */
  class Productgeneral {
  
      //some cols
  
      /**
       * @var integer
       *
       * @ORM\Column(name="product_id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $productId;
  
      /**
       * @var \Doctrine\Common\Collections\Collection
       *
       * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Productimg", inversedBy="product")
       * @ORM\JoinTable(name="producttoimg",
       *   joinColumns={
       *     @ORM\JoinColumn(name="product_id", referencedColumnName="product_id")
       *   },
       *   inverseJoinColumns={
       *     @ORM\JoinColumn(name="img_id", referencedColumnName="img_id")
       *   }
       * )
       */
      private $img;
  
      /**
       * Constructor
       */
      public function __construct() {
          $this-&gt;img = new \Doctrine\Common\Collections\ArrayCollection();
      }
  
      //getter &amp; setters
  }
  
  /**
   * Productimg
   * @ORM\Table(name="ProductImg")
   * @ORM\Entity
   */
  class Productimg {
      /**
       * @var integer
       *
       * @ORM\Column(name="img_id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $imgId;
  
      /**
       * @var \Doctrine\Common\Collections\Collection
       *
       * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Productgeneral", mappedBy="img")
       */
      private $product;
  
      /**
       * Constructor
       */
      public function __construct() {
          $this-&gt;product = new \Doctrine\Common\Collections\ArrayCollection();
      }
  
      //getters &amp; setters
  }
  </code></pre>
  
  <p>When I run:</p>
  
  <pre><code>*$this-&gt;getDoctrine()-&gt;getRepository('AppBundle:Productgeneral')-&gt;findAll();*
  </code></pre>
  
  <p>I get every column with its correct value but <code>img</code>; which returns a <code>PersistentCollection</code> instead of an array of all the images.</p>
  
  <p>Am I doing something wrong? Or have I just misunderstand the behavior of the relationship?</p>