Delete Notice_to_status when a notice is deleted
This commit is contained in:
parent
e9e06879bb
commit
6c7262c8ca
|
@ -411,4 +411,21 @@ class TwitterBridgePlugin extends Plugin
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a notice gets deleted, remove the Notice_to_status mapping
|
||||||
|
*
|
||||||
|
* @param Notice $notice The notice getting deleted
|
||||||
|
*
|
||||||
|
* @return boolean hook value
|
||||||
|
*/
|
||||||
|
|
||||||
|
function onNoticeDeleteRelated($notice)
|
||||||
|
{
|
||||||
|
$n2s = Notice_to_status::staticGet('notice_id', $notice->id);
|
||||||
|
if (!empty($n2s)) {
|
||||||
|
$n2s->delete();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user