Symfony表单集合 - 错误

I have a Symfony form collection that is essentially embedding a form and will allow multiple Specification objects to be created and I'm getting a host of errors which should not be appearing.

Notes:

Symfony Version: 2.3.30

Implementation: I have used this method before and it's worked perfectly as per the Symfony documentation (I even tried copying the relevent entities and forms from another project using this method that did work into this one and was still getting the same errors!)

Code:

Entities:

<?php
/**
 * product
 * @package AppBundle\Entity
 * @author Pete Robinson
 **/
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use AppBundle\Utils\Traits\Doctrine\Timestampable;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 * @ORM\Table(name="product")
 */
class Product
{
    ~snip snip snip - ID and other text fields~

    /**
     * specifications
     * @ORM\OneToMany(targetEntity="Specification", mappedBy="product")
     * @var object ArrayCollection
     **/
    private $specifications;

The child entity:

<?php
/**
 * product
 * @package AppBundle\Entity
 **/
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="specification")
 */
class Specification
{
    /**
     * product
     * @ORM\ManyToOne(targetEntity="Product", inversedBy="specifications")
     * @var object Product
     **/
    private $product;

The form:

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Regex;

class ProductType extends AbstractType
{
    /**
     * set default options
     * @return void
     **/
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'csrf_protection' => false,
            'data_class' => 'AppBundle\Entity\Product'
        ));
    }

    /**
     * build form
     * @param FormBuilderInterface $buidler
     * @param array $options
     * @return void
     **/
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder

            ->add('specifications', 'collection', array(
                'type' => new SpecificationType(),
                'allow_add' => true,
                'allow_delete' => true,
                'error_bubbling' => false,
                'cascade_validation' => true
            ))
        ;

The error:

 The options "allow_add", "allow_delete", "type" do not exist. Known options
 are: "action", "attr", "auto_initialize", "block_name", "by_reference", 
"cascade_validation", "compound", "constraints", "csrf_field_name",
"csrf_message", "csrf_protection", "csrf_provider", "data", "data_class",
"disabled", "empty_data", "error_bubbling", "error_mapping",
"extra_fields_message", "inherit_data", "intention", "invalid_message",
"invalid_message_parameters", "label", "label_attr", "mapped", "max_length",
"method", "pattern", "post_max_size_message", "property_path", "read_only",
"required", "translation_domain", "trim", "validation_groups", "virtual"

As far as I can see, I've followed the Symfony documentation regarding embedded forms correctly, the same as I always do - and yet I'm getting this issue. Has anybody seen this before?

Final FYI: Composer.json

    {
    "name": "project",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-0": {
            "": "src/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": "~2.2,>=2.2.3,<2.5",
        "doctrine/dbal": "<2.5",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0",
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "doctrine/doctrine-fixtures-bundle": "2.2.*@dev",
        "gregwar/image-bundle": "dev-master",
        "gedmo/doctrine-extensions": "dev-master"

    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "stable",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

EDIT: SpecificationType below - in the same directory with same namespace as ProductType

    <?php
/**
 * specification form
 **/
namespace AdminBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Regex;

class SpecificationType extends AbstractType
{
    /**
     * set default options
     * @return void
     **/
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'csrf_protection' => false,
            'data_class' => 'AppBundle\Entity\Specification'
        ));
    }

    /**
     * build form
     * @param FormBuilderInterface $buidler
     * @param array $options
     * @return void
     **/
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('value', 'text', array(
                'label' => 'Value *',
                'label_attr' => array(
                    'class' => 'col-sm-2 control-label'
                ),
                'attr' => array(
                    'class' => 'form-control'
                ),
                'constraints' => array(
                    new NotBlank(array(
                        'message' => 'Specification value is required'
                    ))
                )
            ))
            ->add('remove', 'button', array(
                'attr' => array(
                    'class' => 'btn btn-danger right padded remove_item'
                )
            ))
        ;
    }

Solved. I have a doctrine entity named Collection that the Product form was using to select an item from (in this project, a Collection is essentially a Category). For some reason, this was messing up further down the form object where I wanted to use a symfony form collection. It's all namespaced so there shouldn't have been class conflicts but it seems that Symfony doesn't like Entities named Collection.

I renamed the entity to ProductCollection and it fixed the issue trying to use an embedded form as a collection.

Thanks for your suggestions.