2011-09-19 4 views
0

한 사용자의 모든 필드에서 null을 설정하고 싶습니다. 이 예를 들어 간단한 필드 인 경우 는 :* @method 사용자 setGroups() 현재 레코드의 "Groups"컬렉션을 설정합니다.

* @method Users    setNumber()     Sets the current record's "number" value 

그럼 난합니다

$user = $query; 
$user->setNumber(NULL); 
$user->save(); 

이 확인 작업,하지만 난 할 경우이

* @method Users   setGroups()   Sets the current record's "Groups" collection 

에 대한 추가하지만 싶습니다 :

$user = $query; 
$user->setNumer(NULL); 
$user->setUsers(NULL); 
$user->save(); 

오류가 있습니다 :

Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting many-to-many references. 

이 두 번째 인수는 어떻게되어야합니까?

답변

0
$user['Groups'] = new Doctrine_Collection('Group'); 

즉 당신은 값 그룹의이

객체 빈 컬렉션을 만들고있어
관련 문제