开发者

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 $categoryPlacements


in 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜