delete bookmark stuff when deleting notice

This commit is contained in:
Evan Prodromou 2010-12-18 02:39:44 -05:00
parent 563f067508
commit 6b7931bcc8
1 changed files with 11 additions and 0 deletions

View File

@ -76,6 +76,17 @@ class BookmarkPlugin extends Plugin
return true;
}
function onNoticeDeleteRelated($notice)
{
$nb = Notice_bookmark::staticGet('notice_id', $notice->id);
if (!empty($nb)) {
$nb->delete();
}
return true;
}
/**
* Load related modules when needed
*