2010-05-19 2 views
0

나는 장소 모델에게 항목은 & 엔트리 모델이 부모
모든 것이 잘하지만, 어떻게 결과 행 $의 categoryPlacements젠드 프레임 워크에 findDependentRowset 결과를 삭제하는 방법


장소 모델에서 삭제할 수 있습니다
$ entryModel = new Model_EntryModel();
$ entryRow = $ entryModel-> find ($ entryId) -> current();
$ categoryPlacements = $ entryRow-> findDependentRowset ($ this); 내가 $의 categoryPlacements을 삭제하려면이 경우


내가 categoryPlacements-> toarray()를 사용하고 삭제하지만, 또 다른 쉬운 방법은 장소 모델
결과?

답변

0

데이터베이스의 키를 누르면이 문제가 해결 될 수 있습니다.

$categoryPlacements = $entryRow->findDependentRowset($this); 
foreach ($categoryPlacements as $placement){ 
    $where = $db->getAdapter()->quoteInto('id = ?',$placement->id); 
    $db->delete($where); 
} 

죄송합니다. 귀하가 필요로하는 것이 아닌 경우, 죄송합니다.

관련 문제