full_name und full_name_dep methoden für Contact
[kivitendo-erp.git] / SL / DB / Contact.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 package SL::DB::Contact;
5
6 use strict;
7
8 use SL::DB::MetaSetup::Contact;
9 use SL::DB::Helper::CustomVariables (
10   module      => 'Contacts',
11   cvars_alias => 1,
12 );
13
14 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
15 __PACKAGE__->meta->make_manager_class;
16
17 sub full_name {
18   my ($self) = @_;
19   die 'not an accessor' if @_ > 1;
20   join ', ', grep $_, $self->cp_name, $self->cp_givenname;
21 }
22
23 sub full_name_dep {
24   my ($self) = @_;
25   die 'not an accessor' if @_ > 1;
26   $self->full_name
27     . join '', map { " ($_)" } grep $_, $self->cp_abteilung;
28 }
29
30 1;