0
我有以下代碼設置:的Symfony2 - NoSuchPropertyException
表格/ CompanyType:
->add('employeeCollection', 'entity', array(
'class' => 'xyBundle:Person',
'property' => 'name',
'by_reference' => false
))
實體/公司:
/**
* @ORM\ManyToMany(targetEntity="Person", inversedBy="employmentCollection")
*/
private $employeeCollection;
public function addEmployeeCollection(Person $employee) {
return $this->addEmployee($employee);
}
實體/人:
/**
* @ORM\ManyToMany(targetEntity="Company", mappedBy="employeeCollection")
*/
private $employmentCollection;
由於最新的更新o f Symfony2編輯公司並嘗試更新時出現新錯誤。 (在最新的Symonfy2更新之前,一切正常)。
奇怪的是相結合的方法和屬性(員工得到employoo):
Neither the property "employeeCollection" nor one of the methods "addEmployooCollection()", "setEmployeeCollection()", "__set()" or "__call()" exist and have public access in class "xyBundle\Entity\Company".
如果您複製了直接從源代碼錯誤,它說「addEmployooCollection()」。你在某個地方有錯字嗎? – Sehael
我搜索了我的完整項目「employoo」,但沒有發現任何與之匹配的項目。 – Nino