title: Symfony2 Form collection Could not load type CollectionType
body: <p>I am trying build a form using symfony2 form CollectionType With onetoMany relationship in between two entities. But it always end with Invalid argument exception Could not load type "Symfony\Component\Form\Extension\Core\Type\CollectionType".
  I have Two entities called Ticket and Attachment. A ticket has many attachments and each attachment relates to single ticket.</p>
  
  <p>In Tickets Entity :</p>
  
  <pre><code>/**
   * @ORM\OneToMany(targetEntity="Attachment", mappedBy="ticket", fetch="EXTRA_LAZY", cascade={"persist"})
   */
  private $attachments;
  </code></pre>
  
  <p>And in Attachment Entity :</p>
  
  <pre><code>/**
   * @var integer
   * @ORM\ManyToOne(targetEntity="Ticket", inversedBy="attachments", fetch="LAZY")
   * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
   */
  private $ticket;
  </code></pre>
  
  <p>AttachmentType Form :</p>
  
  <pre><code>/**
   * @param FormBuilderInterface $builder
   * @param array $options
   */
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('name')
          -&gt;add('file')
      ;
  }
  
  /**
   * @param OptionsResolverInterface $resolver
   */
  public function setDefaultOptions(OptionsResolverInterface $resolver)
  {
      $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'Attachment'
      ));
  }
  </code></pre>
  
  <p>TicketType Form :</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $formBuilderInterface, array $options){
      $formBuilderInterface
          -&gt;add("subject", "text", array(
                  "label"=&gt;"RaiseTicketType.labels.subject.label",
                  "attr" =&gt; array(
                      "class" =&gt; "ui-flat",
                      "placeholder"=&gt;"RaiseTicketType.labels.subject.label"
                  )
              )
          )
          -&gt;add("attachments", CollectionType::class, array(
                  'entry_type' =&gt; AttachmentType::class,
                  'allow_add' =&gt; true,
                  'allow_delete' =&gt; true
              )
          );
      ;
  }
  
  public function setDefaultOptions(OptionsResolverInterface $optionsResolverInterface){
      $optionsResolverInterface-&gt;setDefaults(array(
          'data_class' =&gt; 'Ticket'
      ));
  }
  </code></pre>
  
  <p>I have already import the CollectionType namespace</p>