Revision 26b9f320
Von Sven Schöling vor etwa 8 Jahren hinzugefügt
SL/DB/Helper/Manager.pm | ||
---|---|---|
22 | 22 |
my $class = shift; |
23 | 23 |
|
24 | 24 |
my $found; |
25 |
eval { $found = $class->find_by(@_); }; |
|
25 |
eval { |
|
26 |
$found = $class->find_by(@_); |
|
27 |
1; |
|
28 |
} or die $@; |
|
26 | 29 |
return defined $found ? $found : $class->object_class->new; |
27 | 30 |
} |
28 | 31 |
|
Auch abrufbar als: Unified diff
SL::DB::Manager: find_by_or_create bubbelt jetzt exceptions