Francois Gouget : testbot: Document Item::OnDelete().

Alexandre Julliard julliard at winehq.org
Tue Jan 16 11:32:25 CST 2018


Module: tools
Branch: master
Commit: 3dd26c762949946124ff73d1c207ced3956209f7
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=3dd26c762949946124ff73d1c207ced3956209f7

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Jan 16 04:02:09 2018 +0100

testbot: Document Item::OnDelete().

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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) = @_;




More information about the wine-cvs mailing list