且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Symfony2:在链配置的名称空间中找不到类"Doctrine \ Common \ Collections \ ArrayCollection"

更新时间:2022-05-13 05:47:53

我已经将此工作了,但我没有

The times I have gotten this to work, I did not

use Doctrine\Common\Collections\ArrayCollection; 

我只是

$this->field = new \Doctrine\Common\Collections\ArrayCollection();

在我的构造函数中.

此外,您可能需要考虑将住户"(似乎是客户中的成员)添加为实体形式:

Also, you may want to consider adding Household (which appear to be the members in clients) as an entity form:

->add('members', 'entity', array(
    'type' => new HouseholdType(),
    'allow_add' => true, 
    'by_reference' => false,
    ));