Revision d8559071
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
SL/DB/CustomVariable.pm | ||
---|---|---|
64 | 64 |
require SL::DB::Customer; |
65 | 65 |
|
66 | 66 |
my $id = int($self->number_value); |
67 |
return $id ? SL::DB::Customer->new(id => $id)->load() : 0;
|
|
67 |
return $id ? SL::DB::Customer->new(id => $id)->load() : undef;
|
|
68 | 68 |
} elsif ( $type eq 'vendor' ) { |
69 | 69 |
require SL::DB::Vendor; |
70 | 70 |
|
71 | 71 |
my $id = int($self->number_value); |
72 |
return $id ? SL::DB::Vendor->new(id => $id)->load() : 0;
|
|
72 |
return $id ? SL::DB::Vendor->new(id => $id)->load() : undef;
|
|
73 | 73 |
} elsif ( $type eq 'part' ) { |
74 | 74 |
require SL::DB::Part; |
75 | 75 |
|
76 | 76 |
my $id = int($self->number_value); |
77 |
return $id ? SL::DB::Part->new(id => $id)->load() : 0;
|
|
77 |
return $id ? SL::DB::Part->new(id => $id)->load() : undef;
|
|
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
goto &text_value; # text, textfield, date and select |
Auch abrufbar als: Unified diff
SL::DB::CustomVariable->value: undef anstelle von 0 wenn ref.Objekt nicht existiert