Revision cf085911
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/DB/Default.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 | 1 |
package SL::DB::Default; |
5 | 2 |
|
6 | 3 |
use strict; |
... | ... | |
10 | 7 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
11 | 8 |
__PACKAGE__->meta->make_manager_class; |
12 | 9 |
|
10 |
sub get_default_currency { |
|
11 |
my $self = _selfify(@_); |
|
12 |
my @currencies = grep { $_ } split(/:/, $self->curr || ''); |
|
13 |
return $currencies[0] || ''; |
|
14 |
} |
|
15 |
|
|
16 |
sub _selfify { |
|
17 |
my ($class_or_self) = @_; |
|
18 |
return $class_or_self if ref($class_or_self); |
|
19 |
return SL::DB::Manager::Default->get_all(limit => 1)->[0]; |
|
20 |
} |
|
21 |
|
|
13 | 22 |
1; |
Auch abrufbar als: Unified diff
Auslesen der Standardwährung