title: The class 'Doctrine\ORM\PersistentCollection' was not found in the chain configured namespaces
body: <p>I am using in project Zend Framework 2 with Doctrine 2 ORM. 
  I am trying to persist a many to many relation. I followed th documentation described <a href="http://docs.doctrine-project.org/en/latest/reference/association-mapping.html" rel="nofollow">here</a> (manytomany).
  While trying to persist data: <code>$em-&gt;persist($form-&gt;getData());</code> I got the error: </p>
  
  <pre><code>"The class 'Doctrine\ORM\PersistentCollection' was not found in the chain configured namespaces".
  </code></pre>
  
  <p>Any suggestions ?</p>
  
  <p>To be more clear I added below some code:</p>
  
  <p>First I annotated entities like documentation said, for many to many relation:</p>
  
  <pre><code> /**
   * @ORM\ManyToMany(targetEntity="\User\Entity\Client", mappedBy="reportSettings")
   */
  private $client;
  
  public function __construct() {
      $this-&gt;client = new ArrayCollection();
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity="\Statistics\Entity\ReportSettings", inversedBy="client")
   * @ORM\JoinTable(name="report_client_settings",
   *      joinColumns={@ORM\JoinColumn(name="client_id", referencedColumnName="id")},
   *      inverseJoinColumns={@ORM\JoinColumn(name="report_setting_id", referencedColumnName="id")})
   */
  private $reportSettings;
  
  public function __construct() {
      $this-&gt;reportSettings = new ArrayCollection();
  }
  </code></pre>
  
  <p>And in the controller</p>
  
  <pre><code>$form = new UpdateReportSettingsForm();
  
      $form-&gt;bind($reportSettings);
  
      $request = new Request();
  
      if ($request-&gt;isPost()) {
          $form-&gt;setData($request-&gt;getPost());
  
          if ($form-&gt;isValid()) {
           $data = $form-&gt;getData();
            $em-&gt;persist($data); // here I got the error - The class 'Doctrine\ORM\PersistentCollection' was not found in the chain configured namespaces
            $em-&gt;flush();
  </code></pre>
  
  <p>}</p>
  
  <p>I also use in the form DoctrineModule\Form\Element\ObjectMultiCheckbox.
  An simple <code>var_dump($data)</code> - return a persistent collection.</p>