Revision 9fdd2fb1
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
SL/GenericTranslations.pm | ||
---|---|---|
1 | 1 |
package GenericTranslations; |
2 | 2 |
|
3 | 3 |
use SL::DBUtils; |
4 |
use SL::DB; |
|
4 | 5 |
|
5 | 6 |
use strict; |
6 | 7 |
|
... | ... | |
90 | 91 |
} |
91 | 92 |
|
92 | 93 |
sub save { |
94 |
my ($self, %params) = @_; |
|
93 | 95 |
$main::lxdebug->enter_sub(); |
94 | 96 |
|
97 |
my $rc = SL::DB->client->with_transaction(\&_save, %params); |
|
98 |
|
|
99 |
$::lxdebug->leave_sub; |
|
100 |
return $rc; |
|
101 |
} |
|
102 |
|
|
103 |
sub _save { |
|
95 | 104 |
my $self = shift; |
96 | 105 |
my %params = @_; |
97 | 106 |
|
... | ... | |
100 | 109 |
my $myconfig = \%main::myconfig; |
101 | 110 |
my $form = $main::form; |
102 | 111 |
|
103 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig);
|
|
112 |
my $dbh = $params{dbh} || SL::DB->client->dbh;
|
|
104 | 113 |
|
105 | 114 |
$params{translation} =~ s/^\s+//; |
106 | 115 |
$params{translation} =~ s/\s+$//; |
... | ... | |
139 | 148 |
do_query($form, $dbh, $q_insert, @v_insert); |
140 | 149 |
} |
141 | 150 |
|
142 |
$dbh->commit() unless ($params{dbh}); |
|
143 |
|
|
144 |
$main::lxdebug->leave_sub(); |
|
151 |
return 1; |
|
145 | 152 |
} |
146 | 153 |
|
147 | 154 |
|
Auch abrufbar als: Unified diff
GenericTranslations: single-dbh