1 package SL::DB::Default;
6 use SL::DB::MetaSetup::Default;
8 __PACKAGE__->meta->initialize;
10 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
11 __PACKAGE__->meta->make_manager_class;
13 sub get_default_currency {
14 my $self = shift->get;
15 return $self->currency->name || '' if $self->currency_id;
20 my ($class_or_self) = @_;
21 return $class_or_self if ref($class_or_self);
22 return SL::DB::Manager::Default->get_all(limit => 1)->[0];
26 # Compatibility function: back in the day there was only a single
30 croak("SL::DB::Default::address is a read-only accessor") if @_;
32 my $zipcode_city = join ' ', grep { $_ } ($self->address_zipcode, $self->address_city);
34 return join "\n", grep { $_ } ($self->address_street1, $self->address_street2, $zipcode_city, $self->address_country);