how to delete findDependentRowset result in Zend Framework
I have place model & entry model that entry is parent
everything is fine but how can I delete the result row $categoryPlacementsin place model:
$entryModel = new Model_EntryModel(); $entryRow = $entryModel->find ( $entryId )->current (); $categoryPlacements = $entryRow->findDependentRowset($this);in this case i want to delete the $categoryPlacements result in place model
I can use开发者_如何学Go categoryPlacements->toarray() and then delete but is another easy way?Foering Keys at the database could solve this issue.
$categoryPlacements = $entryRow->findDependentRowset($this);
foreach ($categoryPlacements as $placement){
$where = $db->getAdapter()->quoteInto('id = ?',$placement->id);
$db->delete($where);
}
Sorry if this is not what you need, regard´s.
精彩评论