Francois Gouget : testbot: Document Item::OnDelete().
Module: tools Branch: master Commit: 3dd26c762949946124ff73d1c207ced3956209f7 URL: https://source.winehq.org/git/tools.git/?a=commit;h=3dd26c762949946124ff73d1... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Tue Jan 16 04:02:09 2018 +0100 testbot: Document Item::OnDelete(). Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/lib/ObjectModel/Item.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testbot/lib/ObjectModel/Item.pm b/testbot/lib/ObjectModel/Item.pm index 88c9d1a..6296130 100644 --- a/testbot/lib/ObjectModel/Item.pm +++ b/testbot/lib/ObjectModel/Item.pm @@ -433,6 +433,25 @@ sub Validate($) return (undef, undef); } +=pod +=over 12 + +=item C<OnDelete()> + +Prepares the item for deletion. + +The default implementation deletes any related 'Detailref' object as these +have a foreign key referencing this Item, which would prevent its deletion. +This allows the deletion of Items even if the database does not support +'ON DELETE CASCADE'. To preserve this behavior OnDelete() implementations +should remove any other foreign key that would prevent the deletion of an Item. + +Returns undef if successful, or an error message if the Item should not be +deleted or something prevents its deletion. + +=back +=cut + sub OnDelete($) { my ($self) = @_;
participants (1)
-
Alexandre Julliard