Revision 5d74fd02
Von Sven Schöling vor fast 12 Jahren hinzugefügt
SL/DB/CsvImportReport.pm | ||
---|---|---|
4 | 4 |
package SL::DB::CsvImportReport; |
5 | 5 |
|
6 | 6 |
use strict; |
7 |
use SL::DBUtils; |
|
7 | 8 |
|
8 | 9 |
use SL::DB::MetaSetup::CsvImportReport; |
9 | 10 |
|
... | ... | |
63 | 64 |
} |
64 | 65 |
} |
65 | 66 |
|
67 |
# implementes cascade delete as per documentation |
|
68 |
sub destroy { |
|
69 |
my ($self) = @_; |
|
70 |
|
|
71 |
my $dbh = $self->db->dbh; |
|
72 |
|
|
73 |
$dbh->begin_work; |
|
74 |
|
|
75 |
do_query($::form, $dbh, 'DELETE FROM csv_import_report_status WHERE csv_import_report_id = ?', $self->id); |
|
76 |
do_query($::form, $dbh, 'DELETE FROM csv_import_report_rows WHERE csv_import_report_id = ?', $self->id); |
|
77 |
do_query($::form, $dbh, 'DELETE FROM csv_import_reports WHERE id = ?', $self->id); |
|
78 |
|
|
79 |
if ($self->profile_id) { |
|
80 |
do_query($::form, $dbh, 'DELETE FROM csv_import_profile_settings WHERE csv_import_profile_id = ?', $self->profile_id); |
|
81 |
do_query($::form, $dbh, 'DELETE FROM csv_import_profiles WHERE id = ?', $self->profile_id); |
|
82 |
} |
|
83 |
|
|
84 |
$dbh->commit; |
|
85 |
} |
|
86 |
|
|
66 | 87 |
1; |
Auch abrufbar als: Unified diff
destroy methode für CsvImportReport