Revision 51b3b122
Von Sven Schöling vor etwa 1 Jahr hinzugefügt
SL/DB/Helper/TypeDataProxy.pm | ||
---|---|---|
1 | 1 |
package SL::DB::Helper::TypeDataProxy; |
2 | 2 |
|
3 | 3 |
use strict; |
4 |
use Scalar::Util qw(weaken); |
|
5 | 4 |
|
6 | 5 |
sub new { |
7 | 6 |
my ($class, $record_class, $type) = @_; |
... | ... | |
17 | 16 |
|
18 | 17 |
# convenience methods for common topics in type data |
19 | 18 |
sub text { |
20 |
my $self = shift; |
|
21 |
$self->[1]->can("get3")->($self->[0], "text", @_); |
|
19 |
_via("get3", [ "text" ], @_); |
|
22 | 20 |
} |
23 | 21 |
|
24 | 22 |
sub properties { |
25 |
my $self = shift; |
|
26 |
$self->[1]->can("get3")->($self->[0], "properties", @_); |
|
23 |
_via("get3", [ "properties" ], @_); |
|
27 | 24 |
} |
28 | 25 |
|
29 | 26 |
sub show_menu { |
30 |
my $self = shift; |
|
31 |
$self->[1]->can("get3")->($self->[0], "show_menu", @_); |
|
27 |
_via("get3", [ "show_menu" ], @_); |
|
32 | 28 |
} |
33 | 29 |
|
34 | 30 |
sub rights { |
31 |
_via("get3", [ "rights" ], @_); |
|
32 |
} |
|
33 |
|
|
34 |
sub _via { |
|
35 |
my $method = shift; |
|
36 |
my $additional_args = shift; |
|
35 | 37 |
my $self = shift; |
36 |
$self->[1]->can("get3")->($self->[0], "rights", @_);
|
|
38 |
$self->[1]->can($method)->($self->[0], @$additional_args, @_);
|
|
37 | 39 |
} |
38 | 40 |
|
39 | 41 |
sub AUTOLOAD { |
Auch abrufbar als: Unified diff
TypeDataProxy: _via